server-ts: Port services/import/utils

This commit is contained in:
Elian Doran 2024-02-25 07:54:51 +02:00
parent fa0ed35752
commit 052a0a44f2
No known key found for this signature in database

View File

@ -1,6 +1,6 @@
"use strict"; "use strict";
function handleH1(content, title) { function handleH1(content: string, title: string) {
content = content.replace(/<h1>([^<]*)<\/h1>/gi, (match, text) => { content = content.replace(/<h1>([^<]*)<\/h1>/gi, (match, text) => {
if (title.trim() === text.trim()) { if (title.trim() === text.trim()) {
return ""; // remove whole H1 tag return ""; // remove whole H1 tag
@ -11,6 +11,6 @@ function handleH1(content, title) {
return content; return content;
} }
module.exports = { export = {
handleH1 handleH1
}; };