mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-26 22:43:06 -04:00
[blog][bug] fix parseMarkdown skipping paragraphs with html tags
This commit is contained in:
parent
589db2201b
commit
cb3c903d7b
@ -14,7 +14,8 @@ export default async function parseMarkdown(markdown) {
|
|||||||
const imgMatch = content.match('<img src="([^"]+)"[^>]*>');
|
const imgMatch = content.match('<img src="([^"]+)"[^>]*>');
|
||||||
const img = imgMatch ? imgMatch[1] : null;
|
const img = imgMatch ? imgMatch[1] : null;
|
||||||
let intro = [];
|
let intro = [];
|
||||||
for (let introMatch of content.matchAll('<p[^>]*>([^<]+)</p>')) {
|
|
||||||
|
for (let introMatch of content.matchAll(/<p[^>]*>(.+?)<\/p>/gms)) {
|
||||||
const p = introMatch[1].replace(/(<([^>]+)>)/ig, '').replace(/\s+/g, ' ');
|
const p = introMatch[1].replace(/(<([^>]+)>)/ig, '').replace(/\s+/g, ' ');
|
||||||
intro = [...intro, ...p.split(' ')];
|
intro = [...intro, ...p.split(' ')];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user