walle / gimli

Utility for converting markup files to pdf files
https://github.com/walle/gimli
MIT License
538 stars 44 forks source link

Syntax Highlighting using ``` java fails #33

Closed abbourne closed 11 years ago

abbourne commented 11 years ago

I've installed gimli 0.4.1 with coderay 1.0.8 and the syntax highlighting in markdown files is not working for me.

using the back tick notation

 --- java code here

in my markdown file, I always get the following error:

/Users/billb/.rvm/gems/ruby-1.9.3-p327@octopress/gems/coderay-1.0.8/lib/coderay/helpers/plugin.rb:220:in validate_id': Invalid id given: java (ArgumentError) from /Users/billb/.rvm/gems/ruby-1.9.3-p327@octopress/gems/coderay-1.0.8/lib/coderay/helpers/plugin.rb:50:in[]' from /Users/billb/.rvm/gems/ruby-1.9.3-p327@octopress/gems/coderay-1.0.8/lib/coderay/encoder.rb:83:in encode' from /Users/billb/.rvm/gems/ruby-1.9.3-p327@octopress/gems/coderay-1.0.8/lib/coderay.rb:198:inencode' from /Users/billb/.rvm/gems/ruby-1.9.3-p327@octopress/gems/coderay-1.0.8/lib/coderay/tokens_proxy.rb:23:in encode' from /Users/billb/.rvm/gems/ruby-1.9.3-p327@octopress/gems/coderay-1.0.8/lib/coderay/tokens_proxy.rb:32:inmethod_missing' from /Users/billb/.rvm/gems/ruby-1.9.3-p327@octopress/gems/gimli-0.4.1/lib/gimli/markup/code_block.rb:21:in highlighted' from /Users/billb/.rvm/gems/ruby-1.9.3-p327@octopress/gems/gimli-0.4.1/lib/gimli/markup/code.rb:33:inblock in process' from /Users/billb/.rvm/gems/ruby-1.9.3-p327@octopress/gems/gimli-0.4.1/lib/gimli/markup/code.rb:32:in each' from /Users/billb/.rvm/gems/ruby-1.9.3-p327@octopress/gems/gimli-0.4.1/lib/gimli/markup/code.rb:32:inprocess' from /Users/billb/.rvm/gems/ruby-1.9.3-p327@octopress/gems/gimli-0.4.1/lib/gimli/markup/renderer.rb:58:in post_process_data' from /Users/billb/.rvm/gems/ruby-1.9.3-p327@octopress/gems/gimli-0.4.1/lib/gimli/markup/renderer.rb:30:inrender' from /Users/billb/.rvm/gems/ruby-1.9.3-p327@octopress/gems/gimli-0.4.1/lib/gimli/converter.rb:27:in block in convert!' from /Users/billb/.rvm/gems/ruby-1.9.3-p327@octopress/gems/gimli-0.4.1/lib/gimli/converter.rb:25:ineach' from /Users/billb/.rvm/gems/ruby-1.9.3-p327@octopress/gems/gimli-0.4.1/lib/gimli/converter.rb:25:in convert!' from /Users/billb/.rvm/gems/ruby-1.9.3-p327@octopress/gems/gimli-0.4.1/lib/gimli.rb:29:inprocess!' from /Users/billb/.rvm/gems/ruby-1.9.3-p327@octopress/gems/gimli-0.4.1/bin/gimli:23:in <top (required)>' from /Users/billb/.rvm/gems/ruby-1.9.3-p327@octopress/bin/gimli:19:inload' from /Users/billb/.rvm/gems/ruby-1.9.3-p327@octopress/bin/gimli:19:in <main>' from /Users/billb/.rvm/gems/ruby-1.9.3-p327@octopress/bin/ruby_noexec_wrapper:14:ineval' from /Users/billb/.rvm/gems/ruby-1.9.3-p327@octopress/bin/ruby_noexec_wrapper:14:in `

'

walle commented 11 years ago

I tried with this:

Java

System.out.println("Hello");
# Java

```java
System.out.println("Hello");


And it works fine, could you giva an example of markup that doesn't work?
abbourne commented 11 years ago

I played around and found the problem. gimli fails when there are trailing spaces after the language token. The attached file fails (It has trailing blanks) Remove the trailing blanks, and it runs fine

Thanks for your help and quick reply to my email.

On Sun, Dec 2, 2012 at 11:07 AM, Fredrik Wallgren notifications@github.comwrote:

I tried with this: Java

System.out.println("Hello");

Java

System.out.println("Hello");

And it works fine, could you giva an example of markup that doesn't work?

— Reply to this email directly or view it on GitHubhttps://github.com/walle/gimli/issues/33#issuecomment-10931345.

cen1 commented 7 years ago

Still the same problem in version 0.5.9. Why was this closed?