From 1cf0dab1d218582457bce9c839e845b920fecee0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Sun, 20 Aug 2023 16:02:28 +0200 Subject: [PATCH] markdown: avoid adding newlines to blockquote, css: style for blockquote --- common.css | 7 +++++++ markdown.awk | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) 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 ) -- 2.39.2