Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transliterated-header-ids error #70

lydell opened this issue Aug 5, 2013 · 4 comments

transliterated-header-ids error #70

lydell opened this issue Aug 5, 2013 · 4 comments


Copy link

@lydell lydell commented Aug 5, 2013

$ ruby --version && kramdown --version && gem list | grep stringex && kramdown --transliterated-header-ids
ruby 2.0.0p247 (2013-06-27) [x64-mingw32]
stringex (2.0.8)
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/stringex-2.0.8/lib/stringex/unidecoder.rb:70:in `<module:Stringex>': uninitialized const
ant Stringex::StringExtensions (NameError)
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/stringex-2.0.8/lib/stringex/unidecoder.rb:69:in `<top (required)>'
        from c:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `require'
        from c:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
        from c:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:35:in `require'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/kramdown-1.1.0/lib/kramdown/utils/unidecoder.rb:24:in `<module:Unidecoder>'

        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/kramdown-1.1.0/lib/kramdown/utils/unidecoder.rb:16:in `<module:Utils>'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/kramdown-1.1.0/lib/kramdown/utils/unidecoder.rb:13:in `<module:Kramdown>'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/kramdown-1.1.0/lib/kramdown/utils/unidecoder.rb:12:in `<top (required)>'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/kramdown-1.1.0/lib/kramdown/converter/base.rb:156:in `generate_id'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/kramdown-1.1.0/lib/kramdown/converter/html.rb:137:in `convert_header'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/kramdown-1.1.0/lib/kramdown/converter/html.rb:78:in `block in inner'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/kramdown-1.1.0/lib/kramdown/converter/html.rb:77:in `each'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/kramdown-1.1.0/lib/kramdown/converter/html.rb:77:in `inner'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/kramdown-1.1.0/lib/kramdown/converter/html.rb:332:in `convert_root'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/kramdown-1.1.0/lib/kramdown/converter/html.rb:65:in `convert'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/kramdown-1.1.0/lib/kramdown/converter/base.rb:79:in `convert'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/kramdown-1.1.0/lib/kramdown/document.rb:120:in `method_missing'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/kramdown-1.1.0/bin/kramdown:61:in `block in <top (required)>'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/kramdown-1.1.0/bin/kramdown:61:in `each'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/kramdown-1.1.0/bin/kramdown:61:in `<top (required)>'
        from c:/Ruby200-x64/bin/kramdown:23:in `load'

Windows 7 x64.

Copy link

@gettalong gettalong commented Aug 5, 2013

Try a stringex version below 2.0.0, 1.5.1 should work.

@ghost ghost assigned gettalong Aug 5, 2013
Copy link

@ghost ghost commented Aug 5, 2013

If it helps, running this code

  2.0.8 2.0.7 2.0.6 2.0.5
  2.0.4 2.0.3 2.0.2 2.0.1
  2.0.0 1.5.1 1.5.0 1.3.2
  1.3.1 1.2.0 1.1.0 1.0.2


for baz in ${foo[*]}
  gem uninstall -I stringex
  gem install -v $baz stringex
  if kramdown --transliterated-header-ids <<< "$bar" 2>/dev/null
    printf '\e[1;32m%s\e[m\n' "$baz GOOD"
    printf '\e[1;31m%s\e[m\n' "$baz BAD"

Yields this

2.0.8 BAD
2.0.7 BAD
2.0.6 BAD
2.0.5 BAD
2.0.4 BAD
2.0.3 BAD
2.0.2 BAD
2.0.1 BAD
2.0.0 BAD
1.5.1 GOOD
1.5.0 BAD
1.3.2 GOOD
1.3.1 BAD
1.2.0 BAD
1.1.0 BAD
1.0.2 BAD
1.0.0 BAD
Copy link

@gettalong gettalong commented Aug 6, 2013

Thanks @svnpenn! Good to know!

They changed quite a bit between the 1.5.1 and the 2.0.0 version. The things kramdown uses have been changed to be more complicated and now depend on some static confguration which is not good for a library in most cases.

I didn't want to duplicate the translation files because it would just blow up the size of kramdown but I should probably have a look at the 2.0.x versions to see how to make them usable with kramdown.

Copy link

@gettalong gettalong commented Aug 31, 2013

I have fixed this issue by loading the necessary data files myself instead of relying on the stringex library to do it.

@gettalong gettalong closed this Aug 31, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants