Bugs: Browse | Submit New | Admin

[#29647] Abbreviation containing brackets sometimes causes NoMethodError

Date:
2012-09-25 18:00
Priority:
3
Submitted By:
Stephan Dale (stephan)
Assigned To:
Thomas Leitner (gettalong)
Category:
Parser
State:
Closed
Summary:
Abbreviation containing brackets sometimes causes NoMethodError

Detailed description
An abbreviation containing brackets (curly, square, or parens) will cause the following error in some situations:

NoMethodError: undefined method `empty?' for nil:NilClass
	from /usr/local/lib64/ruby/gems/1.8/gems/kramdown-0.14.0/lib/kramdown/converter/html.rb:331:in `convert_abbreviation'
...

I've found the following usage to generate this error...

In a link:

"[(X)HTML](http://en.wikipedia.org/wiki/Xhtml)\n\n*[(X)HTML]: (eXtensible) HyperText Markup Language"

As the first item in a list:

"* (X)HTML test \n* line two\n\n*[(X)HTML]: (eXtensible) HyperText Markup Language"

But strangely _no_ problem if it's not the first item:

"* test (X)HTML\n\n*[(X)HTML]: (eXtensible) HyperText Markup Language"

I've been unable to work around this by escaping the bracket nor by using HTML character codes.

Add A Comment: Notepad

Please login


Followup

Message
Date: 2013-02-02 08:02
Sender: Thomas Leitner

Thanks for reporting!

It was a parsing bug in the abbreviation parser, it handled exactly
this case (abbrev def with non-word first character at beginning
of text) wrongly. I have fixed it now.

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
close_date2013-02-02 08:022013-02-02 08:02gettalong
category_idNone2013-02-02 08:02gettalong
status_idOpen2013-02-02 08:02gettalong
assigned_tonone2012-10-16 16:03gettalong