feat: change regexpresion
This commit is contained in:
parent
d753619240
commit
420a844d1b
|
|
@ -11,6 +11,7 @@
|
|||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"incremental": true,
|
||||
"lib": ["es2020", "dom"],
|
||||
"plugins": [
|
||||
{
|
||||
"name": "next"
|
||||
|
|
|
|||
|
|
@ -177,15 +177,14 @@ export const stripHtmlValidation = (
|
|||
.replace(/<ul>/, "\n<ul>")
|
||||
.replace(/<\/ul>\n/, "</ul>")
|
||||
.replace(
|
||||
/<li.*?>(.*?)<\/li.*?>/gms,
|
||||
/<li.*?>([.\s\S]*?)<\/li.*?>/gm,
|
||||
(match, p1) => {
|
||||
return `<li><p>- ${p1.replace(/\n/gms, '')}\n</p></li>`;
|
||||
return `<li><p>- ${p1.replace(/\n/gm, '')}\n</p></li>`;
|
||||
}
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
console.log(processedHtml);
|
||||
return striptags(processedHtml, ['h1', 'h2', 'h3']);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue