]> git.plutz.net Git - cgilite/commitdiff
markdown: avoid adding newlines to blockquote, css: style for blockquote
authorPaul Hänsch <paul@plutz.net>
Sun, 20 Aug 2023 14:02:28 +0000 (16:02 +0200)
committerPaul Hänsch <paul@plutz.net>
Sun, 20 Aug 2023 14:02:28 +0000 (16:02 +0200)
common.css
markdown.awk

index be1567b70a26fdb821c3e95e7f04ee6cb53f0387..51feb2efa7b7dbb61ce7a5aa73c426775037e62b 100644 (file)
@@ -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; }
index 506d22d08474b5f4a14dc5953c1dda121f4b9678..ffa225b477f6e8ff3dd1b157bc0f6e715df0a494 100755 (executable)
@@ -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 "<blockquote>\n" _nblock( gensub( /(^|\n)> /, "\n", "g", substr(block, 1, st - 1) ) ) "</blockquote>\n\n" \
+    return "<blockquote>" gensub( /^\n|\n$/, "", "g",  _nblock( gensub( /(^|\n)> /, "\n", "g", substr(block, 1, st - 1) ) ) ) "</blockquote>\n\n" \
            _block( substr(block, st + len) );
 
   # Pipe Tables (pandoc / php md / gfm )