Comments
-
Greg Hurrell
Status changed:
- From: New
- To: Open
-
Greg Hurrell
Looks like I've definitely found something that makes the wikitext parser choke. Posting the full log excerpt caused
issues#show
to freak out as well (I had to edit the description to remove the snippet). Here's the exception:ActionView::TemplateError (can't convert nil into String) on line #50 of app/views/issues/show.html.haml: 47: -if @issue.description.blank? 48: none 49: -else 50: =@issue.description.w :base_heading_level => 1 51: -if admin? 52: %tr 53: %th Public?
Looks like I might have to reassign this to the wikitext module...
-
Greg Hurrell
Product changed:
- From: wincent.dev
- To: wikitext
-
Greg Hurrell
I can reproduce this in irb with this dastardly string:
"I wasn't going to update to [[nginx 0.6.36]] but seeing as I am about to start testing the [[nginx upload module]] (see [/issues/1193 ticket #1193]) and I would have to rebuild [[nginx]] anyway for that, I thought I'd use the latest stable release.\n\n= Building on [[Mac OS X]] [[Leopard]] 10.5.6 =\n\n== Build process ==\n\n<pre>wget http://www.grid.net.ru/nginx/download/nginx_upload_module-2.0.9.tar.gz\ntar xzvf nginx_upload_module-2.0.9.tar.gz \nwget http://sysoev.ru/nginx/nginx-0.6.36.tar.gz\ntar xzvf nginx-0.6.36.tar.gz\ncd nginx-0.6.36\n./configure --prefix=/usr/local/nginx \\\n --with-http_ssl_module \\\n --add-module=../nginx_upload_module-2.0.9\nmake\nsudo make install</pre>\n\nThe build is pretty much identical to the normal process (see \"[[]]\" for example), but you'll see something like this at the configuration stage:\n\n<pre>configuring additional modules\nadding module in ../nginx_upload_module-2.0.9\n + ngx_http_upload_module was configured</pre>\n\n== Changes ==\n\n\n"
Stick that in a variable,
bad
, and try running it through the parser:>> bad.w TypeError: can't convert nil into String from /Library/Ruby/Gems/1.8/gems/wikitext-1.5.2/lib/wikitext/string.rb:19:in `parse' from /Library/Ruby/Gems/1.8/gems/wikitext-1.5.2/lib/wikitext/string.rb:19:in `w' from (irb):6
-
Greg Hurrell
Here we go, here's the minimal test case:
>> "[[]]".w TypeError: can't convert nil into String from /Library/Ruby/Gems/1.8/gems/wikitext-1.5.2/lib/wikitext/string.rb:19:in `parse' from /Library/Ruby/Gems/1.8/gems/wikitext-1.5.2/lib/wikitext/string.rb:19:in `w' from (irb):16
-
Greg Hurrell
Summary changed:
- From: Exception raised while rendering app/views/articles/_preview.js.haml
- To: Exception raised for empty links
-
Greg Hurrell
So looks like the "link target" can't be empty/nil, although the "link text" can:
$ irb -r wikitext -r wikitext/string >> "[[]]".w TypeError: can't convert nil into String from /Library/Ruby/Gems/1.8/gems/wikitext-1.5.2/lib/wikitext/string.rb:19:in `parse' from /Library/Ruby/Gems/1.8/gems/wikitext-1.5.2/lib/wikitext/string.rb:19:in `w' from (irb):1 >> "[[|]]".w TypeError: can't convert nil into String from /Library/Ruby/Gems/1.8/gems/wikitext-1.5.2/lib/wikitext/string.rb:19:in `parse' from /Library/Ruby/Gems/1.8/gems/wikitext-1.5.2/lib/wikitext/string.rb:19:in `w' from (irb):2 >> "[[a|]]".w => "<p><a href=\"/wiki/a\">a</a></p>\n" >> "[[|b]]".w TypeError: can't convert nil into String from /Library/Ruby/Gems/1.8/gems/wikitext-1.5.2/lib/wikitext/string.rb:19:in `parse' from /Library/Ruby/Gems/1.8/gems/wikitext-1.5.2/lib/wikitext/string.rb:19:in `w' from (irb):4
-
Greg Hurrell
Ok, now fixed and released in 1.5.3.
-
Greg Hurrell
Status changed:
- From: Open
- To: Closed
-
Greg Hurrell
The new version has been deployed to the site. Note how you can now use invalid links (eg. [[]], [[|]], [[|foo]]) with no ill effects.
Add a comment
Comments are now closed for this issue.