bhollis / maruku

A pure-Ruby Markdown-superset interpreter (Official Repo).
MIT License
500 stars 80 forks source link

Line can't begin with `@`. #70

Closed Peeja closed 11 years ago

Peeja commented 11 years ago

Apparently there's a defunct metadata syntax which used @:

$ echo "@ foo" | maruku
 ___________________________________________________________________________
| Maruku tells you:
+---------------------------------------------------------------------------
| Please use the new meta-data syntax: 
|   http://maruku.rubyforge.org/proposal.html
| 
| At line 1
|   metadata --> |@ foo|
+---------------------------------------------------------------------------
!/usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/errors_management.rb:49:in `maruku_error'
!/usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_block.rb:101:in `parse_blocks'
!/usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_block.rb:41:in `parse_text_as_markdown'
!/usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/input/parse_doc.rb:55:in `parse_doc'
!/usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/maruku-0.6.1/lib/maruku/maruku.rb:30:in `initialize'
\___________________________________________________________________________

But it can't be escaped:

$ echo "\@ foo" | maruku
<p>\@ foo</p>

My current workaround is to add a zero width non-joiner in front of the @, just so it's not the first thing on the line:

$ echo "&zwnj;@ foo"
<p>&zwnj;@ foo</p>
bhollis commented 11 years ago

Yeah, that syntax should really be removed.

bhollis commented 11 years ago

OK, I have a test for this, but I also have a workaround. Put a space at the beginning of the line, and you'll get @ foo.

distler commented 11 years ago

For whatever it's worth, this was fixed here.

distler commented 11 years ago

Fix is now on trunk.