Awkee / pandoc

Automatically exported from code.google.com/p/pandoc
GNU General Public License v2.0
0 stars 0 forks source link

-B not after <body> with --toc #217

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
==========================

echo "My -B file contents" > kaka.html
echo -e "%My Title \n#My title \nMy Text" | pandoc -f markdown -Ss -B kaka.html 
--toc | tidy -
utf8  -q --force-output yes --show-warnings no

What is the expected output? What do you see instead?
==================================
I see

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content=
"HTML Tidy for Mac OS X (vers 31 October 2006 - Apple Inc. build 15.3), see 
www.w3.org" />
<title>My Title</title>
<meta http-equiv="Content-Type" content=
"text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
<meta name="date" content="" />
</head>
<body>
<h1 class="title">My Title</h1>
<div id="TOC">
<ul>
<li><a href="#my-title">My title</a></li>
</ul>
</div>
My -B file contents
<div id="my-title">
<h1><a href="#TOC">My title</a></h1>
<p>My Text</p>
</div>
</body>
</html>

I expect -B just before <body>, ie:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content=
"HTML Tidy for Mac OS X (vers 31 October 2006 - Apple Inc. build 15.3), see 
www.w3.org" />
<title>My Title</title>
<meta http-equiv="Content-Type" content=
"text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
<meta name="date" content="" />
</head>
<body>
My -B file contents
<h1 class="title">My Title</h1>
<div id="TOC">
<ul>
<li><a href="#my-title">My title</a></li>
</ul>
</div>
<div id="my-title">
<h1><a href="#TOC">My title</a></h1>
<p>My Text</p>
</div>
</body>
</html>

What version of the product are you using? On what operating system?
============================================
pandoc 1.4
OSX 10.6.2

Please provide any additional information below.
==============================
When -B is used with --toc, the order produced is <body>, #TOC, "-B contents".
However documentation states "(...) includes the contents of filename 
(verbatim) at the beginning 
of the document body (e.g. after the <body> tag in HTML (...)"

ps. templates, and utf8 additions, greatly appreciated :)

Original issue reported on code.google.com by m3fi...@gmail.com on 14 Feb 2010 at 2:14

GoogleCodeExporter commented 9 years ago
Currently the "after" and "before" are added to the text that replaces $body$ 
in the 
templates.  And "after" and "before" have an effect even when --standalone 
isn't 
specified.  I think, in light of this issue, that it would be best to change 
things so that 
-A and -B only have an effect when --standalone is specified. This way we can 
include $after$ and $before$ in the templates, and users can put them before or 
after $toc$ as desired.

If this doesn't sound like the right solution, please comment.

Original comment by fiddloso...@gmail.com on 28 Feb 2010 at 7:46

GoogleCodeExporter commented 9 years ago
Fixed in r1883.

Original comment by fiddloso...@gmail.com on 13 Mar 2010 at 4:12