[kramdown-users] feature request - ignore ERB-style code

Thomas Leitner t_leitner at gmx.at
Sun Apr 4 02:59:31 EDT 2010


On Sun, 28 Mar 2010 15:45:04 -0700, Matt Neuburg wrote:
> It would be a great help to me if kramdown would ignore ERB
> expressions, such as this:
> 
> <% yoho="yoho" %>
> 
> What I'd like kramdown to do when it sees something like that is (1)
> ignore what's inside it, so the quotation marks are not made curly,
> (2) ignore the tag marks, so they are not entityized, and (3) ignore
> the paragraph as a whole, so it isn't wrapped in <p> tags.

You are using two markup languages: one language that processes the
whole text (i.e. kramdown) and one that processes only certain, special
tags (i.e. ERB).

It is clear that kramdown cannot and will not support this feature
request because it then would need to support, following the same
logic, JSP tags, ASP tags, PHP tags, .... kramdown is not built for
this but ERB is. ERB is designed to work on *any* text and leave all
text alone *except* its special ERB tags.

So although kramdown is written in Ruby, it will not handle ERB tags
specially. I recommend running ERB first and then kramdown since this is
what other (static) web site generation also do (e.g. [webgen][1]).

-- Thomas

[1]: http://webgen.rubyforge.org


More information about the kramdown-users mailing list