correction pb h3

This commit is contained in:
Valentin
2023-07-19 19:26:04 +02:00
parent 0b8dbccb92
commit 2d6ee7c833
3 changed files with 25 additions and 21 deletions
@@ -24,25 +24,22 @@ let baliseWords = [
'breakafter'
];
// Get the HTML content of the "body" element
var bodyContent = $('#body').html();
// Replace text between brackets only if it matches one of the words in the list
bodyContent = bodyContent.replace(/\[([^\/\]]+)\]/g, function(match, word) {
if (baliseWords.includes(word)) {
return '<div class="' + word + '">';
} else {
return match; // No replacement if the word is not in the list
return match;
}
}).replace(/\[\/([^\]]+)\]/g, function(match, word) {
if (baliseWords.includes(word)) {
return '</div>';
} else {
return match; // No replacement if the word is not in the list
return match;
}
});
// Update the content of the "body" element
$('#body').empty().append(bodyContent);