From b9b69d98fbd1185c68d617b576987f0a886c819c Mon Sep 17 00:00:00 2001 From: Mike West Date: Thu, 14 Oct 2010 18:57:35 +0200 Subject: [PATCH] Fixing (among other things) alternate header syntax The following works in Docco, but not in Rocco: Level 1 Heading =============== Level 2 Heading --------------- Happily, the fix is trivial. In Docco, the regex for comments is: # Does the line begin with a comment? l.comment_matcher = new RegExp('^\\s*' + l.symbol + '\\s?') Changing Rocco's comment pattern to: @comment_pattern = Regexp.new("^\\s*#{@options[:comment_chars]}\s?") Solves the problem for me. --- lib/rocco.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rocco.rb b/lib/rocco.rb index f91895e..655d6c4 100644 --- a/lib/rocco.rb +++ b/lib/rocco.rb @@ -85,7 +85,7 @@ class Rocco } @options = defaults.merge(options) @sources = sources - @comment_pattern = Regexp.new("^\\s*#{@options[:comment_chars]}") + @comment_pattern = Regexp.new("^\\s*#{@options[:comment_chars]}\s?") @sections = highlight(split(parse(@data))) end