mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-22 16:11:29 +00:00
chore: auto-fix lint & formatting [skip ci]
This commit is contained in:
parent
50ae8c7607
commit
7179a35457
2 changed files with 12 additions and 4 deletions
|
|
@ -10,7 +10,10 @@ function esc(s: string): string {
|
|||
|
||||
function mdToHtml(s: string): string {
|
||||
let out = esc(s);
|
||||
out = out.replace(/\[([^\]]+)\]\(([^)]+)\)/g, (_m, label, url) => `<a href="${esc(url)}">${label}</a>`);
|
||||
out = out.replace(
|
||||
/\[([^\]]+)\]\(([^)]+)\)/g,
|
||||
(_m, label, url) => `<a href="${esc(url)}">${label}</a>`,
|
||||
);
|
||||
out = out.replace(/\*\*([^*]+)\*\*/g, "<b>$1</b>");
|
||||
out = out.replace(/`([^`]+)`/g, "<code>$1</code>");
|
||||
out = out.replace(/(^|[^*])\*([^*]+)\*/g, "$1<i>$2</i>");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue