[kramdown-users] [ANN] kramdown 0.9.0 released
sunshine at sunshineco.com
Sat Jul 17 06:07:06 EDT 2010
On 7/17/2010 5:19 AM, Thomas Leitner wrote:
>>>> C:\>kramdown test.kd> test.html
>>>> `check': incompatible encoding regexp match (UTF-8 regexp with
>>>> IBM437 string) (Encoding::CompatibilityError)
>>> Hmm... I have to look at this, and probably generate some test cases
>>> for checking encodings under Ruby 1.9. Could you send me the test.kd
>>> document so that I can dig into it and find the offending regexp?
>> I narrowed it down to this fragment:
>> The equivalent<p>François</p> is converted to kramdown and
>> back to HTML without problem.
> I have tried to reproduce the problem but wasn't successful.
I also could not reproduce the problem with that input. I may have
simplified it too much, though I was certain that I had tested and
re-tested before posting. Changing the 'p' tag to an 'a', however, does
reproduce the problem:
kramdown converts this input to:
which has IBM437 encoding on Windows (US/English version). When
converted back to HTML, the above error occurs.
> I have used the following test program (named `tt.rb`):
> require 'kramdown'
> text = "François"
> p [text.encoding, Encoding.default_internal, Encoding.default_external]
> puts Kramdown::Document.new(text).to_html
> $ ruby tt.rb
> [#<Encoding:IBM437>, nil, #<Encoding:UTF-8>]
> where the question mark character is ccedil in the IBM437 encoding.
I can reproduce the crash on Windows with a slightly modified version of
your program where a Markdown "link" with embedded ccedil is assigned to
text = '[François]()'
[#<Encoding:IBM437>, nil, #<Encoding:IBM437>]
`check': incompatible encoding regexp match (UTF-8 regexp with IBM437
By the way, while revisiting this issue, I discovered a kramdown
crasher. When feeding it HTML containing a named anchor (with no 'href'):
it crashes attempting to invoke a method on nil:
C:\>kramdown -i html -o kramdown anchor.html
`convert_a': undefined method `empty?' for nil:NilClass (NoMethodError)
More information about the kramdown-users