[kramdown-users] block inline attribute list problem
Matt Neuburg
matt at tidbits.com
Sat Oct 9 17:55:28 EDT 2010
This works as I expect:
require 'kramdown'
s = <<END
{: #myid}
Testing
END
puts Kramdown::Document.new(s).to_html
<p id="myid">Testing</p>
This, however, does nothing:
require 'kramdown'
s = <<END
{: #myid}
<div>
Testing
</div>
END
puts Kramdown::Document.new(s).to_html
<div>
Testing
</div>
I expect the div to gain the id value "myid", but it doesn't. Okay, so
maybe the problem is that markdown is not turned on for this div. Let's
try it:
require 'kramdown'
s = <<END
{: #myid}
<div markdown="1">
Testing
</div>
END
puts Kramdown::Document.new(s).to_html
<div>
<p id="myid">Testing</p>
</div>
Hmmm. We've skipped the div and attached the id to the internal p.
On the other hand, it all works perfectly if the ALD is *after* the
closing </div>, regardless of whether markdown="1" or not. So, there's a
good workaround, but there is some expectation here that it will work the
same whether the ALD is before or after its block, and it doesn't. m.
--
matt neuburg, phd = matt at tidbits.com, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, 2nd edition
http://www.tidbits.com/matt/default.html#applescriptthings
Take Control of Exploring & Customizing Snow Leopard
http://tinyurl.com/kufyy8
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com
More information about the kramdown-users
mailing list