rtomayko / rocco

Rocco is Docco in Ruby
MIT License
404 stars 80 forks source link

Redcarpet does not format docblocks properly #74

Closed lambda closed 12 years ago

lambda commented 12 years ago

When running the unit tests with Redcarpet 2 installed (using redcarpet/compat to get a backwards compatible API), I get the following error:

  1) Failure:
test_highlighted_in_blocks(RoccoDocblockAnnotationsTest) [/Users/lambda/src/rocco/test/test_docblock_annotations.rb:18]:
<"<p>Comment</p>\n\n<blockquote><p><strong>param</strong> type name</p></blockquote>\n"> expected but was
<"<p>Comment\n&gt; <strong>param</strong> type name  </p>\n">.

This is due to there not being a blank line inserted between the paragraph and the blockquote, so Redcarpet just parses it as all part of one big paragraph.

This test works if I use RDiscount instead of Redcarpet.

I am wondering about the value of trying to support three different Markdown processors at once. Redcarpet changed their API entirely, though supplying a limited backwards-compatible API, and is more strict about separating blocks with blank lines. Bluecloth does not not support the :smart option which is passed into Markdown.new (and throws an error for unknown options, so it fails to work entirely), and Redcarpet's backwards-compatible API ignores any options passed. Is it really important to support three different incompatible Markdown processors, or would it make sense to just switch to one, probably RDiscount as it seems to work best in Rocco?

yumitsu commented 12 years ago

I don't know why not only RDiscount was used as default Markdown library, so I think there is a reason for it. But, anyway, I don't see a quick solution to problem you described.

lambda commented 12 years ago

@yumitsu Yeah, I don't really have a preferences as to which Markdown library is chosen. RDiscount was the easiest one to make work to pass all of the tests. With a little more work, Redcarpet could probably be made to work, or the test case fixed. I just think that it would make more sense to get Rocco to work well with one Markdown library than be partially broken with three.

lambda commented 12 years ago

This appears to be fixed now that Redcarpet is pinned to version 1.

yumitsu commented 12 years ago

In that case I will rollback my pull. Thank you, Brian.