summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-04-25 23:07:30 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-04-25 23:07:30 +0200
commit66b08391b38b0812112ff03d7610d4592c3a1017 (patch)
tree6855f95891085143e0aaa7c3272f8d0d41c49968
parentee160d7c4cc912554fe0a1c7ff9fb802e9e72b64 (diff)
HTML line block: Use class instead of style attribute.
We now issue `<div class="line-block">` and include a default definition for `line-block` in the default templates, instead of hard-coding a `style` on the div. Closes #1623.
-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.hs2
-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
16 files changed, 16 insertions, 1 deletions
diff --git a/data/templates/default.epub2 b/data/templates/default.epub2
index e57b42004..8a5aef14e 100644
--- a/data/templates/default.epub2
+++ b/data/templates/default.epub2
@@ -9,6 +9,7 @@
<style type="text/css">
code{white-space: pre-wrap;}
.smallcaps{font-variant: small-caps;}
+ .line-block{white-space: pre-line;}
$if(quotes)$
q { quotes: "“" "”" "‘" "’"; }
$endif$
diff --git a/data/templates/default.epub3 b/data/templates/default.epub3
index 7fcbf1928..f40f704f1 100644
--- a/data/templates/default.epub3
+++ b/data/templates/default.epub3
@@ -8,6 +8,7 @@
<style type="text/css">
code{white-space: pre-wrap;}
.smallcaps{font-variant: small-caps;}
+ .line-block{white-space: pre-line;}
$if(quotes)$
q { quotes: "“" "”" "‘" "’"; }
$endif$
diff --git a/data/templates/default.html4 b/data/templates/default.html4
index 8f422cf5f..9745f3ba8 100644
--- a/data/templates/default.html4
+++ b/data/templates/default.html4
@@ -17,6 +17,7 @@ $endif$
<style type="text/css">
code{white-space: pre-wrap;}
.smallcaps{font-variant: small-caps;}
+ .line-block{white-space: pre-line;}
$if(quotes)$
q { quotes: "“" "”" "‘" "’"; }
$endif$
diff --git a/data/templates/default.html5 b/data/templates/default.html5
index 633764b3c..dfc66cf4e 100644
--- a/data/templates/default.html5
+++ b/data/templates/default.html5
@@ -17,6 +17,7 @@ $endif$
<style type="text/css">
code{white-space: pre-wrap;}
.smallcaps{font-variant: small-caps;}
+ .line-block{white-space: pre-line;}
$if(quotes)$
q { quotes: "“" "”" "‘" "’"; }
$endif$
diff --git a/data/templates/default.revealjs b/data/templates/default.revealjs
index 92d81e3f1..ac8d6c444 100644
--- a/data/templates/default.revealjs
+++ b/data/templates/default.revealjs
@@ -20,6 +20,7 @@ $endif$
<style type="text/css">
code{white-space: pre-wrap;}
.smallcaps{font-variant: small-caps;}
+ .line-block{white-space: pre-line;}
$if(quotes)$
q { quotes: "“" "”" "‘" "’"; }
$endif$
diff --git a/data/templates/default.s5 b/data/templates/default.s5
index c3896af84..e4fa970d3 100644
--- a/data/templates/default.s5
+++ b/data/templates/default.s5
@@ -18,6 +18,7 @@ $endif$
<style type="text/css">
code{white-space: pre-wrap;}
.smallcaps{font-variant: small-caps;}
+ .line-block{white-space: pre-line;}
$if(quotes)$
q { quotes: "“" "”" "‘" "’"; }
$endif$
diff --git a/data/templates/default.slideous b/data/templates/default.slideous
index 5f194703b..c7dbb5969 100644
--- a/data/templates/default.slideous
+++ b/data/templates/default.slideous
@@ -19,6 +19,7 @@ $endif$
<style type="text/css">
code{white-space: pre-wrap;}
.smallcaps{font-variant: small-caps;}
+ .line-block{white-space: pre-line;}
$if(quotes)$
q { quotes: "“" "”" "‘" "’"; }
$endif$
diff --git a/data/templates/default.slidy b/data/templates/default.slidy
index cde6dd540..e7b3278ff 100644
--- a/data/templates/default.slidy
+++ b/data/templates/default.slidy
@@ -19,6 +19,7 @@ $endif$
<style type="text/css">
code{white-space: pre-wrap;}
.smallcaps{font-variant: small-caps;}
+ .line-block{white-space: pre-line;}
$if(quotes)$
q { quotes: "“" "”" "‘" "’"; }
$endif$
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index d56a6e4ae..9f41f77d1 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -600,7 +600,7 @@ blockToHtml opts (LineBlock lns) =
else do
let lf = preEscapedString "\n"
htmlLines <- mconcat . intersperse lf <$> mapM (inlineListToHtml opts) lns
- return $ H.div ! A.style "white-space: pre-line;" $ htmlLines
+ return $ H.div ! A.class_ "line-block" $ htmlLines
blockToHtml opts (Div attr@(ident, classes, kvs) bs) = do
html5 <- gets stHtml5
let speakerNotes = "notes" `elem` classes
diff --git a/test/lhs-test.html b/test/lhs-test.html
index db90ae95e..ff14e3699 100644
--- a/test/lhs-test.html
+++ b/test/lhs-test.html
@@ -8,6 +8,7 @@
<style type="text/css">
code{white-space: pre-wrap;}
.smallcaps{font-variant: small-caps;}
+ .line-block{white-space: pre-line;}
</style>
<style type="text/css">
div.sourceCode { overflow-x: auto; }
diff --git a/test/lhs-test.html+lhs b/test/lhs-test.html+lhs
index d13aa36e3..f0bfd0465 100644
--- a/test/lhs-test.html+lhs
+++ b/test/lhs-test.html+lhs
@@ -8,6 +8,7 @@
<style type="text/css">
code{white-space: pre-wrap;}
.smallcaps{font-variant: small-caps;}
+ .line-block{white-space: pre-line;}
</style>
<style type="text/css">
div.sourceCode { overflow-x: auto; }
diff --git a/test/s5-basic.html b/test/s5-basic.html
index 4757910b9..b559a9af6 100644
--- a/test/s5-basic.html
+++ b/test/s5-basic.html
@@ -13,6 +13,7 @@
<style type="text/css">
code{white-space: pre-wrap;}
.smallcaps{font-variant: small-caps;}
+ .line-block{white-space: pre-line;}
</style>
<!-- configuration parameters -->
<meta name="defaultView" content="slideshow" />
diff --git a/test/s5-fancy.html b/test/s5-fancy.html
index f80d321fb..a24baa556 100644
--- a/test/s5-fancy.html
+++ b/test/s5-fancy.html
@@ -13,6 +13,7 @@
<style type="text/css">
code{white-space: pre-wrap;}
.smallcaps{font-variant: small-caps;}
+ .line-block{white-space: pre-line;}
</style>
<!-- configuration parameters -->
<meta name="defaultView" content="slideshow" />
diff --git a/test/s5-inserts.html b/test/s5-inserts.html
index b84d2360e..97c8de384 100644
--- a/test/s5-inserts.html
+++ b/test/s5-inserts.html
@@ -11,6 +11,7 @@
<style type="text/css">
code{white-space: pre-wrap;}
.smallcaps{font-variant: small-caps;}
+ .line-block{white-space: pre-line;}
</style>
<link rel="stylesheet" href="main.css" type="text/css" />
STUFF INSERTED
diff --git a/test/writer.html4 b/test/writer.html4
index ccd3af10c..bac16b14c 100644
--- a/test/writer.html4
+++ b/test/writer.html4
@@ -11,6 +11,7 @@
<style type="text/css">
code{white-space: pre-wrap;}
.smallcaps{font-variant: small-caps;}
+ .line-block{white-space: pre-line;}
</style>
</head>
<body>
diff --git a/test/writer.html5 b/test/writer.html5
index f44de80e2..ee921766c 100644
--- a/test/writer.html5
+++ b/test/writer.html5
@@ -11,6 +11,7 @@
<style type="text/css">
code{white-space: pre-wrap;}
.smallcaps{font-variant: small-caps;}
+ .line-block{white-space: pre-line;}
</style>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>