Un traducteur md -> html minimal en awk - retour accueil
git clone git://bebou.netlib.re/katdown
Log | Files | Refs | README |
commit a8871bc27c13366369c8b3fc32d977aeab65a73c parent 02c4e9dbbb5194c28d625cfccac15234599506e7 Auteurice: Arthur Pons <arthur.pons@unistra.fr> Date: Mon, 3 Mar 2025 19:11:09 +0100 pre sont en fait <pre><code> si on en croit cmark Diffstat:
M | katdown | | | 10 | +++++----- |
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/katdown b/katdown @@ -6,11 +6,11 @@ # BLOCS DE CODE # <pre> /^---+$/ { print "<hr />"; next } -inqpre && /^```/ { flush(); print "</pre>"; intqre = 0; next } -/^```/ { print "<pre>"; inqpre = 1; next } +inqpre && /^```/ { flush(); print "</code></pre>"; intqre = 0; next } +/^```/ { print "<pre><code>"; inqpre = 1; next } intpre && /^ / { print substr ($0,1); next } -intpre && /^[^ ]/ { flush(); print "</pre>"; intpre = 0; } -/^ / { print "<pre>"; intpre = 1; print substr ($0,1); next } +intpre && /^[^ ]/ { flush(); print "</code></pre>"; intpre = 0; } +/^ / { print "<pre><code>"; intpre = 1; print substr ($0,1); next } # TITRES # <hN> @@ -85,5 +85,5 @@ function flushtags() { if (inquote) print "</blockquote>" if (inol) print "</ol>" if (inul) print "</ul>" - if (intpre || inqpre) { print "</pre>"; intpre=0; inqpre=0 } + if (intpre || inqpre) { print "</code></pre>"; intpre=0; inqpre=0 } }