Loading lib/jsduck/doc_formatter.rb +1 −1 Original line number Diff line number Diff line Loading @@ -71,7 +71,7 @@ module JsDuck @link_re = /\{@link\s+(\S*?)(?:\s+(.+?))?\}/m @img_re = /\{@img\s+(\S*?)(?:\s+(.+?))?\}/m @example_re = /\{@example\s+(\S*?)\s*\}/m @example_annotation_re = /<pre><code>@example( +[^\n]*)?\s+/m @example_annotation_re = /<pre><code>\s*@example( +[^\n]*)?\s+/m end # Replaces {@link} and {@img} tags, auto-generates links for Loading spec/doc_formatter_spec.rb +14 −0 Original line number Diff line number Diff line Loading @@ -348,6 +348,20 @@ describe JsDuck::DocFormatter do it_should_behave_like "example" end describe "@example code block indented more than 4 spaces" do before do @html = @formatter.format(<<-EOS.gsub(/^ *\|/, "")) |See example: | | @example | if (condition) { | doSomething(); | } EOS end it_should_behave_like "example" end end describe "#shorten" do Loading Loading
lib/jsduck/doc_formatter.rb +1 −1 Original line number Diff line number Diff line Loading @@ -71,7 +71,7 @@ module JsDuck @link_re = /\{@link\s+(\S*?)(?:\s+(.+?))?\}/m @img_re = /\{@img\s+(\S*?)(?:\s+(.+?))?\}/m @example_re = /\{@example\s+(\S*?)\s*\}/m @example_annotation_re = /<pre><code>@example( +[^\n]*)?\s+/m @example_annotation_re = /<pre><code>\s*@example( +[^\n]*)?\s+/m end # Replaces {@link} and {@img} tags, auto-generates links for Loading
spec/doc_formatter_spec.rb +14 −0 Original line number Diff line number Diff line Loading @@ -348,6 +348,20 @@ describe JsDuck::DocFormatter do it_should_behave_like "example" end describe "@example code block indented more than 4 spaces" do before do @html = @formatter.format(<<-EOS.gsub(/^ *\|/, "")) |See example: | | @example | if (condition) { | doSomething(); | } EOS end it_should_behave_like "example" end end describe "#shorten" do Loading