fedimbed: fix blockquotes
This commit is contained in:
parent
022202bd1c
commit
e14cf5f9d9
1 changed files with 6 additions and 2 deletions
|
@ -633,10 +633,14 @@ async function processUrl(msg, url, spoiler = false) {
|
|||
// FIXME: stop being lazy and use an html parser
|
||||
content = content.replace(/<a .*?href="([^"]+?)".*?>(.+?)<\/a>/g, "[$2]($1)");
|
||||
content = content.replace(
|
||||
/<img .*?src="([^"]+?)".*?alt="([^"]+?)".*?\/>/g,
|
||||
"[$2]($1)"
|
||||
/<img .*?src="([^"]+?)".*?(alt|title)="([^"]+?)".*?\/>/g,
|
||||
"[$3]($1)"
|
||||
);
|
||||
content = content.replace(/<\/?\s*br\s*\/?>/g, "\n");
|
||||
content = content.replace(
|
||||
/<blockquote.*?>(.*?)<\/blockquote>/,
|
||||
(_, c) => "> " + c.split("\n").join("\n> ")
|
||||
);
|
||||
content = content.replace(/<\/p><p>/g, "\n\n");
|
||||
content = content.replace(/<ol>/g, "\n");
|
||||
content = content.replace(/<li>/g, "- ");
|
||||
|
|
Loading…
Reference in a new issue