summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-12-26 08:38:19 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2017-12-26 08:40:33 -0800
commit718b2c5837f4a72a6ba58bc5c307431316e7d4dc (patch)
tree051e654ca1f7b50d853a5ccee18538e28643c004
parent9dea8a27e200fe620a36e20f6bbf64c7f1bdad94 (diff)
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.
-rw-r--r--data/templates/default.dzslides1
-rw-r--r--data/templates/default.epub21
-rw-r--r--data/templates/default.epub31
-rw-r--r--data/templates/default.html41
-rw-r--r--data/templates/default.html51
-rw-r--r--data/templates/default.revealjs1
-rw-r--r--data/templates/default.s51
-rw-r--r--data/templates/default.slideous1
-rw-r--r--data/templates/default.slidy1
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs3
-rw-r--r--test/lhs-test.html1
-rw-r--r--test/lhs-test.html+lhs1
-rw-r--r--test/s5-basic.html1
-rw-r--r--test/s5-fancy.html1
-rw-r--r--test/s5-inserts.html1
-rw-r--r--test/writer.html41
-rw-r--r--test/writer.html51
17 files changed, 1 insertions, 18 deletions
diff --git a/data/templates/default.dzslides b/data/templates/default.dzslides
index 73ef045f1..892a434cb 100644
--- a/data/templates/default.dzslides
+++ b/data/templates/default.dzslides
@@ -16,7 +16,6 @@ $endif$
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
- div.line-block{white-space: pre-line;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
$if(quotes)$
q { quotes: "“" "”" "‘" "’"; }
diff --git a/data/templates/default.epub2 b/data/templates/default.epub2
index 2abead3d0..cca9fcf6f 100644
--- a/data/templates/default.epub2
+++ b/data/templates/default.epub2
@@ -10,7 +10,6 @@
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
- div.line-block{white-space: pre-line;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
$if(quotes)$
q { quotes: "“" "”" "‘" "’"; }
diff --git a/data/templates/default.epub3 b/data/templates/default.epub3
index ffe230507..b22714963 100644
--- a/data/templates/default.epub3
+++ b/data/templates/default.epub3
@@ -9,7 +9,6 @@
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
- div.line-block{white-space: pre-line;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
$if(quotes)$
q { quotes: "“" "”" "‘" "’"; }
diff --git a/data/templates/default.html4 b/data/templates/default.html4
index a771599f7..714b3ff2e 100644
--- a/data/templates/default.html4
+++ b/data/templates/default.html4
@@ -18,7 +18,6 @@ $endif$
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
- div.line-block{white-space: pre-line;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
$if(quotes)$
q { quotes: "“" "”" "‘" "’"; }
diff --git a/data/templates/default.html5 b/data/templates/default.html5
index 2272a0179..5c484f376 100644
--- a/data/templates/default.html5
+++ b/data/templates/default.html5
@@ -18,7 +18,6 @@ $endif$
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
- div.line-block{white-space: pre-line;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
$if(quotes)$
q { quotes: "“" "”" "‘" "’"; }
diff --git a/data/templates/default.revealjs b/data/templates/default.revealjs
index 9e3bc8d09..65ab09049 100644
--- a/data/templates/default.revealjs
+++ b/data/templates/default.revealjs
@@ -21,7 +21,6 @@ $endif$
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
- div.line-block{white-space: pre-line;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
$if(quotes)$
q { quotes: "“" "”" "‘" "’"; }
diff --git a/data/templates/default.s5 b/data/templates/default.s5
index 33e539744..e9c36b4d4 100644
--- a/data/templates/default.s5
+++ b/data/templates/default.s5
@@ -19,7 +19,6 @@ $endif$
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
- div.line-block{white-space: pre-line;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
$if(quotes)$
q { quotes: "“" "”" "‘" "’"; }
diff --git a/data/templates/default.slideous b/data/templates/default.slideous
index 4c5e6a7bd..ad58272ae 100644
--- a/data/templates/default.slideous
+++ b/data/templates/default.slideous
@@ -20,7 +20,6 @@ $endif$
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
- div.line-block{white-space: pre-line;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
$if(quotes)$
q { quotes: "“" "”" "‘" "’"; }
diff --git a/data/templates/default.slidy b/data/templates/default.slidy
index 5bc237c91..98b8d669d 100644
--- a/data/templates/default.slidy
+++ b/data/templates/default.slidy
@@ -20,7 +20,6 @@ $endif$
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
- div.line-block{white-space: pre-line;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
$if(quotes)$
q { quotes: "“" "”" "‘" "’"; }
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index f25bbadfb..7ff7284cc 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -670,8 +670,7 @@ blockToHtml opts (LineBlock lns) =
if writerWrapText opts == WrapNone
then blockToHtml opts $ linesToPara lns
else do
- let lf = preEscapedString "\n"
- htmlLines <- mconcat . intersperse lf <$> mapM (inlineListToHtml opts) lns
+ htmlLines <- inlineListToHtml opts $ intercalate [LineBreak] lns
return $ H.div ! A.class_ "line-block" $ htmlLines
blockToHtml opts (Div attr@(ident, classes, kvs') bs) = do
html5 <- gets stHtml5
diff --git a/test/lhs-test.html b/test/lhs-test.html
index 77f75f354..c9777ea7b 100644
--- a/test/lhs-test.html
+++ b/test/lhs-test.html
@@ -9,7 +9,6 @@
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
- div.line-block{white-space: pre-line;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
<style type="text/css">
diff --git a/test/lhs-test.html+lhs b/test/lhs-test.html+lhs
index a17941998..4a121e0d1 100644
--- a/test/lhs-test.html+lhs
+++ b/test/lhs-test.html+lhs
@@ -9,7 +9,6 @@
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
- div.line-block{white-space: pre-line;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
<style type="text/css">
diff --git a/test/s5-basic.html b/test/s5-basic.html
index f126ad1f4..b3b950327 100644
--- a/test/s5-basic.html
+++ b/test/s5-basic.html
@@ -14,7 +14,6 @@
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
- div.line-block{white-space: pre-line;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
<!-- configuration parameters -->
diff --git a/test/s5-fancy.html b/test/s5-fancy.html
index 1befe4052..9f724af96 100644
--- a/test/s5-fancy.html
+++ b/test/s5-fancy.html
@@ -14,7 +14,6 @@
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
- div.line-block{white-space: pre-line;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
<!-- configuration parameters -->
diff --git a/test/s5-inserts.html b/test/s5-inserts.html
index 6779e5b76..efde179d2 100644
--- a/test/s5-inserts.html
+++ b/test/s5-inserts.html
@@ -12,7 +12,6 @@
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
- div.line-block{white-space: pre-line;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
<link rel="stylesheet" href="main.css" type="text/css" />
diff --git a/test/writer.html4 b/test/writer.html4
index ef6d8df74..dc889f07a 100644
--- a/test/writer.html4
+++ b/test/writer.html4
@@ -12,7 +12,6 @@
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
- div.line-block{white-space: pre-line;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
</head>
diff --git a/test/writer.html5 b/test/writer.html5
index a2052e9ea..53fcb84e2 100644
--- a/test/writer.html5
+++ b/test/writer.html5
@@ -12,7 +12,6 @@
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
- div.line-block{white-space: pre-line;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
<!--[if lt IE 9]>