mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-21 11:35:41 -04:00
(blog) fix wrong text-align on <th>
convert deprecated align attribute to inline css modern markdown parsers appear to do this
This commit is contained in:
parent
329440684d
commit
1d3689b7cf
@ -111,6 +111,7 @@ export default async function parseMarkdown(markdown: string, translator: Transl
|
||||
let content = `<div>${
|
||||
markdown
|
||||
.replace(/<table>(.+?)<\/table>/gs, '<div class="table-responsive"><table class="table table-striped small">$1</table></div>')
|
||||
.replace(/align="([^"]+)"/g, 'style="text-align:$1"')
|
||||
.replace(/<a (href="http[^>]+)>/g, (_match, attributes) => {
|
||||
return `<a ${attributes.includes('target=') ? '' : 'target="_blank" '}${attributes.includes('rel=') ? '' : 'rel="noopener" '}${attributes}>`;
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user