[kramdown-users] using kramdown in xhtml

Thomas Leitner t_leitner at gmx.at
Fri Jun 11 12:22:24 EDT 2010


On Fri, 11 Jun 2010 08:39:23 -0500
Elliot Winkler <elliot.winkler at gmail.com> wrote:

> On 6/11/10 12:55 AM, Thomas Leitner wrote:
> > * Just using whatever the user gives to kramdown and outputting it
> > in the same encoding. This is by far the easiest way, in Ruby 1.8
> > and 1.9. The only difference between 1.8 and 1.9 is that in 1.9
> > kramdown knows the encoding whereas in 1.8 kramdown can only assume
> > that the string is ASCII compatible.
> >
> >    So basically the user needs to make sure that the string is in
> > the correct encoding before it is given to kramdown.
> 
> If there were a "keep your hands off my special characters" option in 
> addition to the numeric entities option, that's how I'd think it
> should work. Is there a case in which kramdown needs to convert the
> source text into another encoding?

As explained in a previous email on this thread, kramdown doesn't
transcode the source text - it just takes it as it is.

On Ruby 1.8 this means that kramdown assumes that the source text is
ASCII compatible sothat the literal strings and regexps kramdown
internally uses can be correctly applied.

The situation when running kramdown under Ruby 1.9 is the same as with
Ruby 1.8 except that kramdown *knows* the source encoding and can thus
convert entities to characters if possible.

So kramdown should already be keeping its hands off any special
character! If not, please file a bug report with a test case! Or did
you mean something else with "keep your hands..."?

-- Thomas


More information about the kramdown-users mailing list