Skip to content

Commit

Permalink
HTML line block: Use class instead of style attribute.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jgm committed Apr 25, 2017
1 parent ee160d7 commit 66b0839
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions data/templates/default.epub2
Original file line number Diff line number Diff line change
Expand Up @@ -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$
Expand Down
1 change: 1 addition & 0 deletions data/templates/default.epub3
Original file line number Diff line number Diff line change
Expand Up @@ -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$
Expand Down
1 change: 1 addition & 0 deletions data/templates/default.html4
Original file line number Diff line number Diff line change
Expand Up @@ -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$
Expand Down
1 change: 1 addition & 0 deletions data/templates/default.html5
Original file line number Diff line number Diff line change
Expand Up @@ -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$
Expand Down
1 change: 1 addition & 0 deletions data/templates/default.revealjs
Original file line number Diff line number Diff line change
Expand Up @@ -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$
Expand Down
1 change: 1 addition & 0 deletions data/templates/default.s5
Original file line number Diff line number Diff line change
Expand Up @@ -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$
Expand Down
1 change: 1 addition & 0 deletions data/templates/default.slideous
Original file line number Diff line number Diff line change
Expand Up @@ -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$
Expand Down
1 change: 1 addition & 0 deletions data/templates/default.slidy
Original file line number Diff line number Diff line change
Expand Up @@ -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$
Expand Down
2 changes: 1 addition & 1 deletion src/Text/Pandoc/Writers/HTML.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/lhs-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
1 change: 1 addition & 0 deletions test/lhs-test.html+lhs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
1 change: 1 addition & 0 deletions test/s5-basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
1 change: 1 addition & 0 deletions test/s5-fancy.html
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
1 change: 1 addition & 0 deletions test/s5-inserts.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/writer.html4
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions test/writer.html5
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 66b0839

Please sign in to comment.