Commit a85244e5 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Preserve whitespace in type definitions.

parent a6ed7b63
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -228,7 +228,8 @@ module JsDuck
    end

    def skip_whitespace
      @input.scan(/\s*/)
      ws = @input.scan(/\s*/)
      @out << ws if ws
    end

  end
+7 −0
Original line number Diff line number Diff line
@@ -238,6 +238,13 @@ describe JsDuck::TypeParser do
      p.out.should == '<a href="String">string</a>'
    end

    it "preserves whitespace in output" do
      relations = JsDuck::Relations.new([])
      p = JsDuck::TypeParser.new(relations)
      p.parse("( string | number )")
      p.out.should == '( string | number )'
    end

  end

end