Commit 94fc8729 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Allow @example indented more than 4 spaces.

parent de151745
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
+14 −0
Original line number Diff line number Diff line
@@ -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