[kramdown-users] using kramdown in xhtml
t_leitner at gmx.at
Thu Jun 10 09:15:38 EDT 2010
> I think what I'd really like is the option for actual *characters* to
> be output. Only two characters must be entityized: ampersand and
> less-than. But that's all. I'm making UTF-8 encoded Web pages and I'm
> starting with UTF-8 encoded Markdown / kramdown, so all the
> characters I'm using are legal as they stand. I don't need them
> transformed at all. I type my own em-dashes, ellipses, Ancient Greek,
> etc. The only things I'm not typing myself are the curly quotes and
> curly apostrophe. I think Smartypants produces entities for its curly
> quotes etc. only because it doesn't know what encoding I'll be using.
> But I do know! :) So I'd be happiest if kramdown's Smartypants
> function allowed me to specify that I just want characters for any
> transformations it produces. Then I'd be able to read my own XHTML.
I won't implement this on Ruby 1.8 because of the lack of string
encoding support. However, the feature you want is already on my TODO
list. It will convert entities, smart quotes and typographic symbols
(as handled by the kramdown parser) into their character equivalences
on output - but only under Ruby 1.9. One more incentive to switch from
1.8 to 1.9 ;-)
> On the other hand if I were producing output for a non-UTF-8 milieu
> then everything that isn't ASCII must be entityized. In that case,
> only numeric entities make sense, because there are no named entities
> for most of the characters I use. m.
This won't be done in kramdown. The kramdown parser (as well as the new
HTML parser) doesn't convert between encodings or change normal
characters to entities. Whatever string you give to kramdown comes out
in the same encoding.
More information about the kramdown-users