bhollis / maruku

A pure-Ruby Markdown-superset interpreter (Official Repo).
MIT License
502 stars 80 forks source link

Gist tag doesn't work anymore in Maruku 0.7.0 #123

Closed vdurmont closed 10 years ago

vdurmont commented 10 years ago

I just updated my Jekyll from 1.2.0 to 1.4.2 and Maruku from 0.6.0 to 0.7.0. The gist tag I used before doesn't work anymore. I posted this issue on the Jekyll repository and I was told that the problem came from Maruku:

It's due to the move from Maruku 0.6 to 0.7. Please file this over in: https://github.com/bhollis/maruku

Use a different markdown parser if you can. Other options are kramdown, redcarpet and rdiscount.

The syntax I use is:

{% gist 7360258 %}

And the error I got is:

 ___________________________________________________________________________
| Maruku tells you:
+---------------------------------------------------------------------------
| Malformed HTML starting at "<script src=\"https://gist.github.com/7360992.js\"> </script>"
| ---------------------------------------------------------------------------
| Let's add Jade to our dependencies:N<script src="https://gist.github.com/73
| ------------------------------------|---------------------------------------
|                                     +--- Byte 36
| Shown bytes [0 to 75] of 95:
| >Let's add Jade to our dependencies:
| ><script src="https://gist.github.com/7360992.js"> </script>
|
| At line 49
|      empty     ||
|       text     |Let's add Jade to our dependencies:|
|   raw_html     |<script src="https://gist.github.com/7360992.js"> </script>|
|      empty --> ||
|       text     |(Don't forget to run `npm install` to update the dependencies!)|
|      empty     ||
|       text     |We can now update our `app.js` file to indicate that express has now to use jade as a template engine.|
|
|
| Elements read in span:
|  -
| Current string:
|   "Let's add Jade to our dependencies: "
|
+---------------------------------------------------------------------------
!/usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/gems/2.0.0/gems/maruku-0.7.0/lib/maruku/input/parse_span.rb:423:in `read_inline_html'
!/usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/gems/2.0.0/gems/maruku-0.7.0/lib/maruku/input/parse_span.rb:94:in `read_span'
!/usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/gems/2.0.0/gems/maruku-0.7.0/lib/maruku/input/parse_span.rb:14:in `parse_span'
!/usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/gems/2.0.0/gems/maruku-0.7.0/lib/maruku/input/parse_block.rb:298:in `read_paragraph'
\___________________________________________________________________________

Thanks for your help.

bhollis commented 10 years ago

Maruku certainly doesn't have anything to do with the gist tag. Whoever maintains the gist tag needs to make sure to include a newline before the <script> tag - this will allow it to work consistently in multiple Markdown processors, not just Maruku.

bhollis commented 10 years ago

Just to be clear, I'm still going to try to make it handle this case, because Maruku 0.6.1 did, but it's easy to work around.