Closed GoogleCodeExporter closed 9 years ago
Can't you get around this by using raw html for the header?
<div id="enclosing">
<h1>Foo</h1>
Bar
</div>
etc.
I'm guessing this is a pretty rare kind of case -- wanting a div to surround
the header
and part of the section, but not the whole section -- and I'm reluctant to make
changes if there's a way to work around it.
Original comment by fiddloso...@gmail.com
on 1 Apr 2010 at 11:31
(Sorry for responding so late, I seem to have missed the e-mail notifying of
your
comment.)
Yes, raw HTML works, but that way lies not using Pandoc at all and just writing
everything in HTML. :-P
My use case is that I write the contents of a web page in Markdown, with the
per-page
content in one div—analogously to the id="enclosing"—and then some stuff
like
navigation afterwards—like the id="not_enclosing" div. If I have to use raw
HTML for
headers I'd have to use it for every header everywhere: it's not an isolated
situation.
Original comment by Deewi...@gmail.com
on 24 Apr 2010 at 2:35
If what you want is a navigation section at the end of the document, I'd put
this in
a separate file and include it using the -A option. This is generally best
practice
anyway, since you'll generally have the same nav section across multiple pages.
I'm not sure ending the section when a <div> tag is encountered would always
yield
the desired results -- some people might want their divs to be inside the
section.
How is pandoc going to know?
Providing some way to manually end a section might be a possibility, but I'd
have to
think about an unobtrusive way to do that...
Original comment by fiddloso...@gmail.com
on 24 Apr 2010 at 10:07
I was simplifying: there is content both before and after the enclosing div
which
varies per page. I probably /could/ work around this whole thing somehow but it
would
require rethinking large parts of my build system.
No, ending a section at any </div> wouldn't work. In this case, though, Pandoc
could
know that closing at the </div> is appropriate, since it sees the opening <div>,
which precedes the section, as well. You'd need to keep track of tags nesting
for
that to work. This is probably the most "correct" way of handling this while
keeping
the section-divs.
But like said, I'm fine with just optionally getting rid of the divs inserted by
pandoc, reverting to the old behaviour. It seems to me to be the simplest way of
handling this.
Original comment by Deewi...@gmail.com
on 25 Apr 2010 at 4:59
Issue 239 has been merged into this issue.
Original comment by fiddloso...@gmail.com
on 25 May 2010 at 6:22
Fixed in
9be9bccfcfc2c46459b3da963bc59a37f841fe8a
The new default is not to include the divs (and to put the identifiers directly
on the header elements).
However, the pandoc 1.2-1.5 behavior can be restored using the --section-divs
command-line option.
Original comment by fiddloso...@gmail.com
on 16 Jul 2010 at 5:32
Original issue reported on code.google.com by
Deewi...@gmail.com
on 1 Apr 2010 at 5:18