HTML parse error for valid img tag #36

Closed
ultrasaurus opened this Issue May 9, 2009 · 9 comments

Projects

None yet

2 participants

@ultrasaurus

I can render a regular HTML with this content:

<html>

<img src="http://yuml.me/diagram/class/[Project]-&gt;[Task]"/>

</html>

but if I put the img tag in a mardown file parsed with jekyll, I get the following error:
HTML parse error:
<img src="http://yuml.me/diagram/class/[Project]- />

I'm new to jekyll and not a markdown expert, so maybe I'm missing something. It sure would be cool to use yuml in with the markdown for easy diagrams.

Thanks.

@qrush
Contributor
qrush commented May 9, 2009

I think the main problem with this is that the URL is not escaped. It really should look like this:

http://yuml.me/diagram/class/%5BProject%5D-%3E%5BTask%5D

I suppose URLs could be searched for and escaped. Feel free to whip up a patch for this (with tests).

@ultrasaurus

I was going to take a quick look at the source, but couldn't get 'rake test' to pass. I must be missing some basic dependency:

master $ rake test --trace
(in /Users/sarah/src/jekyll)
** Invoke test (first_time)
** Execute test
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- shoulda (LoadError)
    from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
    from ./test/helper.rb:8
    from ./test/test_filters.rb:1:in `require'
    from ./test/test_filters.rb:1
    from /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake/rake_test_loader.rb:5:in `load'
    from /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake/rake_test_loader.rb:5
    from /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake/rake_test_loader.rb:5:in `each'
    from /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake/rake_test_loader.rb:5
rake aborted!

I'm also not exactly sure how to build/run something that is a gem... I notice there are 154 forks... am I missing something obvious? or instructions/dependencies written somewhere? maybe I'm too much of a newbie to dig in here, but if you want to help me get going then it should be a simple fix.

@qrush
Contributor
qrush commented May 10, 2009

You need to install shoulda... gem install thoughtbot-shoulda

Duly noted though: I need to section on the contribution wiki page for test dependencies.

@ultrasaurus

still running into issues:

master $ rake test
(in /Users/sarah/src/jekyll)
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- rr (LoadError)
    from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
    from ./test/helper.rb:9
    from ./test/test_filters.rb:1:in `require'
    from ./test/test_filters.rb:1
    from /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake/rake_test_loader.rb:5:in `load'
    from /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake/rake_test_loader.rb:5
    from /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake/rake_test_loader.rb:5:in `each'
    from /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake/rake_test_loader.rb:5
rake aborted!
Command failed with status (1): [/System/Library/Frameworks/Ruby.framework/...]

(See full trace by running task with --trace)
master $ gem list rr

*** LOCAL GEMS ***

rr (0.9.0)

Is there some special version of rr that jekyll wants?

@qrush
Contributor
qrush commented May 10, 2009

This definitely is working for me, with rr 0.9.0. Something else is amiss here.

jekyll master $ sudo gem install rr  
Successfully installed rr-0.9.0
1 gem installed
Installing ri documentation for rr-0.9.0...
Installing RDoc documentation for rr-0.9.0...
jekyll master $ irb
>> require 'rr'
=> true
>> exit                                                                                       
jekyll master $ rake test
(in /Users/qrush/Dev/ruby/jekyll)
Loaded suite /Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader
Started
........................................................
Finished in 3.536843 seconds.
@ultrasaurus

Ah, something went awry with the rr installation, fixed now. Rake test passes:

master $ rake test
(in /Users/sarah/src/jekyll)
Loaded suite /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake/rake_test_loader
Started
......................................................You must have the rdiscount gem installed first
..
Finished in 3.463795 seconds.

56 tests, 96 assertions, 0 failures, 0 errors
@ultrasaurus

the root problem is the maruku fails to parse the improper HTML. The way it wants me to write an image is:

![Alt text](http://yuml.me/diagram/class/[Project]->[Task])

which will handle unescaped URLs

@qrush
Contributor
qrush commented May 13, 2009

Started a new wiki page to document this issues and more that will inevitably come up in the future:

http://wiki.github.com/mojombo/jekyll/markup-problems

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment