[Kramdown-users] More HTML corruption
Eric Sunshine
sunshine at sunshineco.com
Mon Dec 14 12:29:05 EST 2009
Hi Thomas,
On 12/14/2009 5:01 AM, Thomas Leitner wrote:
> I have fixed this now and pushed the changes to the github repository.
> Note that there is now a completely new HTML span/block parser in
> kramdown which works a bit different from before. I have updated the
> syntax specification too so you might want to read the section on HTML
> blocks.
A few minor comments regarding the overhauled doc/syntax.page:
"By default, kramdown parses all HTML/XML tags as raw HTML blocks."
I read this as meaning that even span-level HTML tags are parsed raw,
though they are in fact processed as Markdown by default. The "all HTML"
bit is what seems misleading.
"The following list shows which HTML tags are parsed in which mode by
default:"
This is a bit confusing. Perhaps it needs to be qualified as such:
"... mode by default when markdown="1" is applied or :parse_block_html
is true:"
"When setting :parse_block_html to true or using the markdown="1"
attribute..."
At this point, I believe that the set of examples which follow are meant
to be intrepreted as if :parse_block_html is enabled, however, as a
human reader, it is difficult to follow. Perhaps it would be sensible to
make this explicit by applying markdown="1" in each example which
illustrates Markdown processing within HTML (block) elements.
> The main difference with HTML blocks is the handling of the text that
> comes after an HTML/XML tag on the same line. This text is now treated
> as if it appears on a separate line if the HTML tag is parsed as block
> level elements.
The new rules seem pretty reasonable. The default behavior where
arbitrary (block) HTML now passes through the filter unmolested greatly
improves kramdown's usefulness, is more compatible with the original
Markdown, and frees the client from having to employ work-arounds. With
these latest changes, I was able to remove another batch of ugly
{::nomarkdown:} directives.
A user now only need pay special attention to the extra restrictions
when requesting Markdown processing explicitly within HTML blocks, which
is a reasonable trade-off.
I think I may have found a corner case with the latest changes, or
perhaps I misunderstand the documentation. Given the following input:
<dl>
<dt>Moo</dt>
<dd markdown="span">Foo
_Bar_</dd>
</dl>
one would expect:
<dl>
<dt>Moo</dt>
<dd>Foo
<em>Bar</em></dd>
</dl>
but kramdown actually emits:
<dl>
<dt>Moo</dt>
<dd>Foo
_Bar_</dd>
</dl>
Inserting a single space before the "_Bar_" does, however, result in the
expected output.
-- ES
More information about the Kramdown-users
mailing list