From: Paul Hänsch Date: Sun, 20 Aug 2023 14:02:28 +0000 (+0200) Subject: markdown: avoid adding newlines to blockquote, css: style for blockquote X-Git-Url: http://git.plutz.net/?p=cgilite;a=commitdiff_plain;h=1cf0dab1d218582457bce9c839e845b920fecee0 markdown: avoid adding newlines to blockquote, css: style for blockquote --- diff --git a/common.css b/common.css index be1567b..51feb2e 100644 --- a/common.css +++ b/common.css @@ -47,6 +47,13 @@ b, strong { font-weight: bolder; } tt, code, var, samp, kbd { font-family: monospace; } kbd { font-style: italic; } +blockquote { + background-color: #EEE; + margin: .5em 0; + padding: 1em 2em; + white-space: pre-line; +} + ul, ol { padding-left: 1.125em; } dl dt { font-weight: bolder; } table th { font-weight: bold; } diff --git a/markdown.awk b/markdown.awk index 506d22d..ffa225b 100755 --- a/markdown.awk +++ b/markdown.awk @@ -380,7 +380,7 @@ function _block( block, LOCAL, st, len, hlvl, htxt, sec, guard, code, indent, at } else if ( match( block, /^> /) ) { match( block, /(^|\n)[[:space:]]*(\n|$)/ ) || match(block, /$/); len = RLENGTH; st = RSTART; - return "
\n" _nblock( gensub( /(^|\n)> /, "\n", "g", substr(block, 1, st - 1) ) ) "
\n\n" \ + return "
" gensub( /^\n|\n$/, "", "g", _nblock( gensub( /(^|\n)> /, "\n", "g", substr(block, 1, st - 1) ) ) ) "
\n\n" \ _block( substr(block, st + len) ); # Pipe Tables (pandoc / php md / gfm )