Skip to content
Snippets Groups Projects
Unverified Commit 025bf4a5 authored by Johann150's avatar Johann150 Committed by GitHub
Browse files

fix(mfm): remove duplicate br tag/newline (#8616)

parent d3e242a7
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,9 @@ const urlRegex = /^https?:\/\/[\w\/:%#@$&?!()\[\]~.,=+\-]+/;
const urlRegexFull = /^https?:\/\/[\w\/:%#@$&?!()\[\]~.,=+\-]+$/;
export function fromHtml(html: string, hashtagNames?: string[]): string {
// some AP servers like Pixelfed use br tags as well as newlines
html = html.replace(/<br\s?\/?>\r?\n/gi, '\n');
const dom = parse5.parseFragment(html);
let text = '';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment