mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
17 lines
345 B
JavaScript
17 lines
345 B
JavaScript
"use strict";
|
|
|
|
function handleH1(content, title) {
|
|
content = content.replace(/<h1>([^<]*)<\/h1>/gi, (match, text) => {
|
|
if (title.trim() === text.trim()) {
|
|
return ""; // remove whole H1 tag
|
|
} else {
|
|
return `<h2>${text}</h2>`;
|
|
}
|
|
});
|
|
return content;
|
|
}
|
|
|
|
module.exports = {
|
|
handleH1
|
|
};
|