Skip to content

Commit df30e97

Browse files
author
Raniere Silva
committed
Fix template layout
The body variable at Pandoc template **must** not be indented because the indentation will propagate into the HTML. Example: $ cat page.html <!DOCTYPE html> <html> <body> $body$ </body> </html> $ pandoc -s -t html --template=page -o sample.html sample.md $ cat sample.html <!DOCTYPE html> <html> <body> <pre><code>def foo(): return None</code></pre> </body> </html> Solution: $ cat fix.html <!DOCTYPE html> <html> <body> $body$ </body> </html> $ pandoc -s -t html --template=fix -o sample-fix.html sample.md $ cat sample-fix.html <!DOCTYPE html> <html> <body> <pre><code>def foo(): return None</code></pre> </body> </html>
1 parent 6753e09 commit df30e97

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

_layouts/page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<div class="span10 offset1">
1414
<h1 class="title">$title$</h1>
1515
$if(subtitle)$<h2 class="subtitle">$subtitle$</h2>$endif$
16-
$body$
16+
$body$
1717
</div>
1818
</div>
1919
$footer$

_layouts/slides.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<div class="deck-container">
3434

3535
<!-- Begin slides. Just make elements with a class of slide. -->
36-
$body$
36+
$body$
3737
<!-- End slides. -->
3838

3939
<!-- Begin extension snippets. Add or remove as needed. -->

0 commit comments

Comments
 (0)