git.iko.soy/typeable/pandoc
on master help sign in
HTML writer: Use br elements in line blocks...

instead of relying on CSS. Closes #4162. HTML-based templates have had the custom CSS for div.line-block removed. Those maintaining custom templates will want to remove this too. We still enclose line blocks in a div with class line-block.

commit718b2c5837f4a72a6ba58bc5c307431316e7d4dc authorJohn MacFarlane <jgm@berkeley.edu> dateTue 26 Dec 2017, 08:38 (9 years ago) parent9dea8a2
17 files changed+1−18
data/templates/default.dzslides−1 data/templates/default.epub2−1 data/templates/default.epub3−1 data/templates/default.html4−1 data/templates/default.html5−1 data/templates/default.revealjs−1 data/templates/default.s5−1 data/templates/default.slideous−1 data/templates/default.slidy−1 src/Text/Pandoc/Writers/HTML.hs+1−2 test/lhs-test.html−1 test/lhs-test.html+lhs−1 test/s5-basic.html−1 test/s5-fancy.html−1 test/s5-inserts.html−1 test/writer.html4−1 test/writer.html5−1
data/templates/default.dzslides−1
@@ -16,7 +16,6 @@ $endif$
1616 code{white-space: pre-wrap;}
1717 span.smallcaps{font-variant: small-caps;}
1818 span.underline{text-decoration: underline;}
19− div.line-block{white-space: pre-line;}
2019 div.column{display: inline-block; vertical-align: top; width: 50%;}
2120$if(quotes)$
2221 q { quotes: "“" "”" "‘" "’"; }
data/templates/default.epub2−1
@@ -10,7 +10,6 @@
1010 code{white-space: pre-wrap;}
1111 span.smallcaps{font-variant: small-caps;}
1212 span.underline{text-decoration: underline;}
13− div.line-block{white-space: pre-line;}
1413 div.column{display: inline-block; vertical-align: top; width: 50%;}
1514$if(quotes)$
1615 q { quotes: "“" "”" "‘" "’"; }
data/templates/default.epub3−1
@@ -9,7 +9,6 @@
99 code{white-space: pre-wrap;}
1010 span.smallcaps{font-variant: small-caps;}
1111 span.underline{text-decoration: underline;}
12− div.line-block{white-space: pre-line;}
1312 div.column{display: inline-block; vertical-align: top; width: 50%;}
1413$if(quotes)$
1514 q { quotes: "“" "”" "‘" "’"; }
data/templates/default.html4−1
@@ -18,7 +18,6 @@ $endif$
1818 code{white-space: pre-wrap;}
1919 span.smallcaps{font-variant: small-caps;}
2020 span.underline{text-decoration: underline;}
21− div.line-block{white-space: pre-line;}
2221 div.column{display: inline-block; vertical-align: top; width: 50%;}
2322$if(quotes)$
2423 q { quotes: "“" "”" "‘" "’"; }
data/templates/default.html5−1
@@ -18,7 +18,6 @@ $endif$
1818 code{white-space: pre-wrap;}
1919 span.smallcaps{font-variant: small-caps;}
2020 span.underline{text-decoration: underline;}
21− div.line-block{white-space: pre-line;}
2221 div.column{display: inline-block; vertical-align: top; width: 50%;}
2322$if(quotes)$
2423 q { quotes: "“" "”" "‘" "’"; }
data/templates/default.revealjs−1
@@ -21,7 +21,6 @@ $endif$
2121 code{white-space: pre-wrap;}
2222 span.smallcaps{font-variant: small-caps;}
2323 span.underline{text-decoration: underline;}
24− div.line-block{white-space: pre-line;}
2524 div.column{display: inline-block; vertical-align: top; width: 50%;}
2625$if(quotes)$
2726 q { quotes: "“" "”" "‘" "’"; }
data/templates/default.s5−1
@@ -19,7 +19,6 @@ $endif$
1919 code{white-space: pre-wrap;}
2020 span.smallcaps{font-variant: small-caps;}
2121 span.underline{text-decoration: underline;}
22− div.line-block{white-space: pre-line;}
2322 div.column{display: inline-block; vertical-align: top; width: 50%;}
2423$if(quotes)$
2524 q { quotes: "“" "”" "‘" "’"; }
data/templates/default.slideous−1
@@ -20,7 +20,6 @@ $endif$
2020 code{white-space: pre-wrap;}
2121 span.smallcaps{font-variant: small-caps;}
2222 span.underline{text-decoration: underline;}
23− div.line-block{white-space: pre-line;}
2423 div.column{display: inline-block; vertical-align: top; width: 50%;}
2524$if(quotes)$
2625 q { quotes: "“" "”" "‘" "’"; }
data/templates/default.slidy−1
@@ -20,7 +20,6 @@ $endif$
2020 code{white-space: pre-wrap;}
2121 span.smallcaps{font-variant: small-caps;}
2222 span.underline{text-decoration: underline;}
23− div.line-block{white-space: pre-line;}
2423 div.column{display: inline-block; vertical-align: top; width: 50%;}
2524$if(quotes)$
2625 q { quotes: "“" "”" "‘" "’"; }
src/Text/Pandoc/Writers/HTML.hs+1−2
@@ -670,8 +670,7 @@ blockToHtml opts (LineBlock lns) =
670670 if writerWrapText opts == WrapNone
671671 then blockToHtml opts $ linesToPara lns
672672 else do
673− let lf = preEscapedString "\n"
674− htmlLines <- mconcat . intersperse lf <$> mapM (inlineListToHtml opts) lns
673+ htmlLines <- inlineListToHtml opts $ intercalate [LineBreak] lns
675674 return $ H.div ! A.class_ "line-block" $ htmlLines
676675blockToHtml opts (Div attr@(ident, classes, kvs') bs) = do
677676 html5 <- gets stHtml5
test/lhs-test.html−1
@@ -9,7 +9,6 @@
99 code{white-space: pre-wrap;}
1010 span.smallcaps{font-variant: small-caps;}
1111 span.underline{text-decoration: underline;}
12− div.line-block{white-space: pre-line;}
1312 div.column{display: inline-block; vertical-align: top; width: 50%;}
1413 </style>
1514 <style type="text/css">
test/lhs-test.html+lhs−1
@@ -9,7 +9,6 @@
99 code{white-space: pre-wrap;}
1010 span.smallcaps{font-variant: small-caps;}
1111 span.underline{text-decoration: underline;}
12− div.line-block{white-space: pre-line;}
1312 div.column{display: inline-block; vertical-align: top; width: 50%;}
1413 </style>
1514 <style type="text/css">
test/s5-basic.html−1
@@ -14,7 +14,6 @@
1414 code{white-space: pre-wrap;}
1515 span.smallcaps{font-variant: small-caps;}
1616 span.underline{text-decoration: underline;}
17− div.line-block{white-space: pre-line;}
1817 div.column{display: inline-block; vertical-align: top; width: 50%;}
1918 </style>
2019 <!-- configuration parameters -->
test/s5-fancy.html−1
@@ -14,7 +14,6 @@
1414 code{white-space: pre-wrap;}
1515 span.smallcaps{font-variant: small-caps;}
1616 span.underline{text-decoration: underline;}
17− div.line-block{white-space: pre-line;}
1817 div.column{display: inline-block; vertical-align: top; width: 50%;}
1918 </style>
2019 <!-- configuration parameters -->
test/s5-inserts.html−1
@@ -12,7 +12,6 @@
1212 code{white-space: pre-wrap;}
1313 span.smallcaps{font-variant: small-caps;}
1414 span.underline{text-decoration: underline;}
15− div.line-block{white-space: pre-line;}
1615 div.column{display: inline-block; vertical-align: top; width: 50%;}
1716 </style>
1817 <link rel="stylesheet" href="main.css" type="text/css" />
test/writer.html4−1
@@ -12,7 +12,6 @@
1212 code{white-space: pre-wrap;}
1313 span.smallcaps{font-variant: small-caps;}
1414 span.underline{text-decoration: underline;}
15− div.line-block{white-space: pre-line;}
1615 div.column{display: inline-block; vertical-align: top; width: 50%;}
1716 </style>
1817</head>
test/writer.html5−1
@@ -12,7 +12,6 @@
1212 code{white-space: pre-wrap;}
1313 span.smallcaps{font-variant: small-caps;}
1414 span.underline{text-decoration: underline;}
15− div.line-block{white-space: pre-line;}
1615 div.column{display: inline-block; vertical-align: top; width: 50%;}
1716 </style>
1817 <!--[if lt IE 9]>