git.iko.soy/typeable/pandoc
on master help sign in
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.

commit66b08391b38b0812112ff03d7610d4592c3a1017 authorJohn MacFarlane <jgm@berkeley.edu> dateTue 25 Apr 2017, 23:07 (9 years ago) parentee160d7
16 files changed+16−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−1 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.epub2+1
@@ -9,6 +9,7 @@
99 <style type="text/css">
1010 code{white-space: pre-wrap;}
1111 .smallcaps{font-variant: small-caps;}
12+ .line-block{white-space: pre-line;}
1213$if(quotes)$
1314 q { quotes: "“" "”" "‘" "’"; }
1415$endif$
data/templates/default.epub3+1
@@ -8,6 +8,7 @@
88 <style type="text/css">
99 code{white-space: pre-wrap;}
1010 .smallcaps{font-variant: small-caps;}
11+ .line-block{white-space: pre-line;}
1112$if(quotes)$
1213 q { quotes: "“" "”" "‘" "’"; }
1314$endif$
data/templates/default.html4+1
@@ -17,6 +17,7 @@ $endif$
1717 <style type="text/css">
1818 code{white-space: pre-wrap;}
1919 .smallcaps{font-variant: small-caps;}
20+ .line-block{white-space: pre-line;}
2021$if(quotes)$
2122 q { quotes: "“" "”" "‘" "’"; }
2223$endif$
data/templates/default.html5+1
@@ -17,6 +17,7 @@ $endif$
1717 <style type="text/css">
1818 code{white-space: pre-wrap;}
1919 .smallcaps{font-variant: small-caps;}
20+ .line-block{white-space: pre-line;}
2021$if(quotes)$
2122 q { quotes: "“" "”" "‘" "’"; }
2223$endif$
data/templates/default.revealjs+1
@@ -20,6 +20,7 @@ $endif$
2020 <style type="text/css">
2121 code{white-space: pre-wrap;}
2222 .smallcaps{font-variant: small-caps;}
23+ .line-block{white-space: pre-line;}
2324$if(quotes)$
2425 q { quotes: "“" "”" "‘" "’"; }
2526$endif$
data/templates/default.s5+1
@@ -18,6 +18,7 @@ $endif$
1818 <style type="text/css">
1919 code{white-space: pre-wrap;}
2020 .smallcaps{font-variant: small-caps;}
21+ .line-block{white-space: pre-line;}
2122$if(quotes)$
2223 q { quotes: "“" "”" "‘" "’"; }
2324$endif$
data/templates/default.slideous+1
@@ -19,6 +19,7 @@ $endif$
1919 <style type="text/css">
2020 code{white-space: pre-wrap;}
2121 .smallcaps{font-variant: small-caps;}
22+ .line-block{white-space: pre-line;}
2223$if(quotes)$
2324 q { quotes: "“" "”" "‘" "’"; }
2425$endif$
data/templates/default.slidy+1
@@ -19,6 +19,7 @@ $endif$
1919 <style type="text/css">
2020 code{white-space: pre-wrap;}
2121 .smallcaps{font-variant: small-caps;}
22+ .line-block{white-space: pre-line;}
2223$if(quotes)$
2324 q { quotes: "“" "”" "‘" "’"; }
2425$endif$
src/Text/Pandoc/Writers/HTML.hs+1−1
@@ -600,7 +600,7 @@ blockToHtml opts (LineBlock lns) =
600600 else do
601601 let lf = preEscapedString "\n"
602602 htmlLines <- mconcat . intersperse lf <$> mapM (inlineListToHtml opts) lns
603− return $ H.div ! A.style "white-space: pre-line;" $ htmlLines
603+ return $ H.div ! A.class_ "line-block" $ htmlLines
604604blockToHtml opts (Div attr@(ident, classes, kvs) bs) = do
605605 html5 <- gets stHtml5
606606 let speakerNotes = "notes" `elem` classes
test/lhs-test.html+1
@@ -8,6 +8,7 @@
88 <style type="text/css">
99 code{white-space: pre-wrap;}
1010 .smallcaps{font-variant: small-caps;}
11+ .line-block{white-space: pre-line;}
1112 </style>
1213 <style type="text/css">
1314div.sourceCode { overflow-x: auto; }
test/lhs-test.html+lhs+1
@@ -8,6 +8,7 @@
88 <style type="text/css">
99 code{white-space: pre-wrap;}
1010 .smallcaps{font-variant: small-caps;}
11+ .line-block{white-space: pre-line;}
1112 </style>
1213 <style type="text/css">
1314div.sourceCode { overflow-x: auto; }
test/s5-basic.html+1
@@ -13,6 +13,7 @@
1313 <style type="text/css">
1414 code{white-space: pre-wrap;}
1515 .smallcaps{font-variant: small-caps;}
16+ .line-block{white-space: pre-line;}
1617 </style>
1718 <!-- configuration parameters -->
1819 <meta name="defaultView" content="slideshow" />
test/s5-fancy.html+1
@@ -13,6 +13,7 @@
1313 <style type="text/css">
1414 code{white-space: pre-wrap;}
1515 .smallcaps{font-variant: small-caps;}
16+ .line-block{white-space: pre-line;}
1617 </style>
1718 <!-- configuration parameters -->
1819 <meta name="defaultView" content="slideshow" />
test/s5-inserts.html+1
@@ -11,6 +11,7 @@
1111 <style type="text/css">
1212 code{white-space: pre-wrap;}
1313 .smallcaps{font-variant: small-caps;}
14+ .line-block{white-space: pre-line;}
1415 </style>
1516 <link rel="stylesheet" href="main.css" type="text/css" />
1617 STUFF INSERTED
test/writer.html4+1
@@ -11,6 +11,7 @@
1111 <style type="text/css">
1212 code{white-space: pre-wrap;}
1313 .smallcaps{font-variant: small-caps;}
14+ .line-block{white-space: pre-line;}
1415 </style>
1516</head>
1617<body>
test/writer.html5+1
@@ -11,6 +11,7 @@
1111 <style type="text/css">
1212 code{white-space: pre-wrap;}
1313 .smallcaps{font-variant: small-caps;}
14+ .line-block{white-space: pre-line;}
1415 </style>
1516 <!--[if lt IE 9]>
1617 <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>