Skip to content

Commit 65adbce

Browse files
committed
fix(markdown): suppression automatique de l'indentation avant les balises HTML dans la source markdown afin d'éviter la transformation automatique en bloc code
1 parent 994e613 commit 65adbce

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

app/js/markdown/parser.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ export function markdownToHTML(text) {
180180
text = text.replaceAll("\n|", "|");
181181
// gestion des dimensions des images avec la syntaxe CodiMD
182182
text = fixImageDimensionsCodiMD(text);
183+
// Fix pour supprimer l'indentation avant les balises HTML afin d'éviter la transformation automatique en bloc code
184+
text = text.replace(/^[ \t]+(?=<[a-z])/gm, "");
183185
const html = converter.makeHtml(text).replaceAll("&amp;#96", "`&#96`");
184186
return html;
185187
}

app/script.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/script.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)