nex3/maruku — Issue #42: Empty line in script block throws exception
Author: ccaum
Created: 2011-12-15 23:01:36+00:00
State: open

When parsing the following markdown:

\```ruby
hash = {
'key' => 'value'
}

use_hash hash
\```

I get this exception thrown due to the empty line.:

``` ___________________________________________________________________________
| Maruku tells you:
+---------------------------------------------------------------------------
| String finished while reading (break on []) already read: "ruby\n hash = {\n 'key' => 'value'\n }"
| ---------------------------------------------------------------------------
| ```rubyN hash = {N 'key' => 'value'N }EOF
| -------------------------------------------|--------------------------------
| +--- Byte 43
| Shown bytes [0 to 43] of 43:
| >```ruby
| > hash = {
| > 'key' => 'value'
| > }
|
| At line 5
| text | hash = {|
| code | 'key' => 'value'|
| text | }|
| empty --> ||
| text | use_hash hash|
| text |```|
+---------------------------------------------------------------------------
!/usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/errors_management.rb:49:in `maruku_error'
!/usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_span_better.rb:402:in `read_simple'
!/usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_span_better.rb:521:in `read_inline_code'
!/usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_span_better.rb:89:in `read_span'
!/usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_span_better.rb:46:in `parse_span_better'
\___________________________________________________________________________

___________________________________________________________________________
| Maruku tells you:
+---------------------------------------------------------------------------
| I boldly continue
| ---------------------------------------------------------------------------
| ```rubyN hash = {N 'key' => 'value'N }EOF
| -------------------------------------------|--------------------------------
| +--- Byte 43
| Shown bytes [0 to 43] of 43:
| >```ruby
| > hash = {
| > 'key' => 'value'
| > }
|
| At line 5
| text | hash = {|
| code | 'key' => 'value'|
| text | }|
| empty --> ||
| text | use_hash hash|
| text |```|
+---------------------------------------------------------------------------
!/usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/errors_management.rb:56:in `maruku_recover'
!/usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_span_better.rb:403:in `read_simple'
!/usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_span_better.rb:521:in `read_inline_code'
!/usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_span_better.rb:89:in `read_span'
!/usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_span_better.rb:46:in `parse_span_better'
\___________________________________________________________________________

___________________________________________________________________________
| Maruku tells you:
+---------------------------------------------------------------------------
| String finished while reading (break on []) already read: ""
| ---------------------------------------------------------------------------
| use_hash hashN```EOF
| -------------------|--------------------------------------------------------
| +--- Byte 19
| Shown bytes [0 to 19] of 19:
| > use_hash hash
| >```
|
| At line 8
| empty ||
| text | use_hash hash|
| text |```|
+---------------------------------------------------------------------------
!/usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/errors_management.rb:49:in `maruku_error'
!/usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_span_better.rb:402:in `read_simple'
!/usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_span_better.rb:521:in `read_inline_code'
!/usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_span_better.rb:89:in `read_span'
!/usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_span_better.rb:46:in `parse_span_better'
\___________________________________________________________________________

___________________________________________________________________________
| Maruku tells you:
+---------------------------------------------------------------------------
| I boldly continue
```ruby
| ---------------------------------------------------------------------------
| use_hash hashN```EOF
| -------------------|--------------------------------------------------------
| +--- Byte 19
| Shown bytes [0 to 19] of 19:
| > use_hash hash
| >```
|
| At line 8
| empty ||
| text | use_hash hash|
| text |```|
+---------------------------------------------------------------------------
!/usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/errors_management.rb:56:in `maruku_recover'
!/usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_span_better.rb:403:in `read_simple'
!/usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_span_better.rb:521:in `read_inline_code'
!/usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_span_better.rb:89:in `read_span'
!/usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_span_better.rb:46:in `parse_span_better'
\___________________________________________________________________________
/usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_span_better.rb:528:in `read_inline_code': undefined method `[]' for nil:NilClass (NoMethodError)
from /usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_span_better.rb:89:in `read_span'
from /usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_span_better.rb:46:in `parse_span_better'
from /usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_span_better.rb:36:in `parse_lines_as_span'
from /usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_block.rb:275:in `read_paragraph'
from /usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_block.rb:158:in `read_text_material'
from /usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_block.rb:69:in `parse_blocks'
from /usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_block.rb:41:in `parse_text_as_markdown'
from /usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_doc.rb:57:in `parse_doc'
from /usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/maruku.rb:30:in `initialize'
from /usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/bin/maruku:113:in `new'
from /usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/bin/maruku:113
from /usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/bin/maruku:106:in `each'
from /usr/lib/ruby/gems/1.8/gems/maruku-0.6.0/bin/maruku:106
from /usr/bin/maruku:19:in `load'
from /usr/bin/maruku:19
```