img tag is not implemented correctly?
Closed this issue · 3 comments
404pnf commented
>> require 'reverse_markdown'
=> true
test 1
>> s = '<img src="./images/1.jpg">'
=> "<img src=\"./images/1.jpg\">"
>> ReverseMarkdown.parse s
=> "![./images/1.jpg] "
test 2
>> ss = '<img src="./images/1.jpg" alt="some pic">'
=> "<img src=\"./images/1.jpg\" alt=\"some pic\">"
>> ReverseMarkdown.parse ss=> "![some pic][./images/1.jpg] "
test 3, copy from test spec comes with revers_markdown
>> a = '<p><img src="http://foo.bar/dog.png" alt="My Dog" title="Ralph"></p>'
=> "<p><img src=\"http://foo.bar/dog.png\" alt=\"My Dog\" title=\"Ralph\"></p>"
>> ReverseMarkdown.parse a
=> "\n\n![My Dog][http://foo.bar/dog.png] "
xijo commented
Hey 404pnf, thanks for your ticket.
Currently I'm not able to reproduce this issue, the current version with your examples gives me:
ReverseMarkdown.parse '<img src="./images/1.jpg">' => "![](./images/1.jpg)"
ReverseMarkdown.parse '<img src="./images/1.jpg" alt="some pic">' => "![some pic](./images/1.jpg)"
Did you test it on version 0.4.0? Please update your gem otherwise.
Best,
Joe
edit: version confusion, damn, I'm sorry! :)
404pnf commented
version 0.4.0 works!
install it from github
$ gem specific_install -l https://github.com/xijo/reverse_markdown.git
git installing from https://github.com/xijo/reverse_markdown.git
Cloning into '/tmp/d20121127-13315-wkwn30'...
WARNING: gnome-keyring:: couldn't connect to: /tmp/keyring-FTgpwU/pkcs11: No such file or directory
remote: Counting objects: 183, done.
remote: Compressing objects: 100% (99/99), done.
remote: Total 183 (delta 82), reused 175 (delta 77)
Receiving objects: 100% (183/183), 29.86 KiB, done.
Resolving deltas: 100% (82/82), done.
Successfully built RubyGem
Name: reverse_markdown
Version: 0.4.0
File: reverse_markdown-0.4.0.gem
Successfully installed reverse_markdown-0.4.0
1 gem installed
Installing ri documentation for reverse_markdown-0.4.0...
Installing RDoc documentation for reverse_markdown-0.4.0...
successfully installed
alas, at last!
>> ReverseMarkdown.parse '<img src="abc.png">'
=> "![](abc.png)"
other failed attempts
removing older version
Successfully uninstalled reverse_markdown-0.2.1
$ sudo gem uninstall reverse_markdown
Successfully uninstalled reverse_markdown-0.3.0
$ sudo gem install reverse_markdown
Fetching: reverse_markdown-0.3.0.gem (100%)
Successfully installed reverse_markdown-0.3.0
1 gem installed
Installing ri documentation for reverse_markdown-0.3.0...
Installing RDoc documentation for reverse_markdown-0.3.0...
tests failed.
install rvm and use rvm gem to install v0.3.0
tests failed
404pnf commented
newer version worked as specified.
close issue.