Commit 7cacce44 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Fix handling of unclosed HTML tags in DocFormatter.

parent 880efb7b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ module JsDuck
          # <a> closed, auto-detection may continue when no more <a> tags open.
          open_a_tags -= 1
          out += s.scan(/<\/a>/)
        elsif s.check(/<.*?>/)
        elsif s.check(/</)
          # Ignore all other HTML tags
          out += s.scan_until(/>|\Z/)
        else
+5 −0
Original line number Diff line number Diff line
@@ -269,6 +269,11 @@ describe JsDuck::DocFormatter do
          'See <a href="Foo.Bar"><a>Foo.Bar</a> Ext.XTemplate</a>'
      end

      it "handles unclosed HTML tags" do
        @formatter.replace('Malformed <img').should ==
          'Malformed <img'
      end

    end

    describe "with type information" do