Loading lib/jsduck/css/sass_parser.rb +3 −3 Original line number Diff line number Diff line Loading @@ -28,14 +28,14 @@ module JsDuck nodes.each do |node| if node.class == Sass::Tree::CommentNode if node.type == :normal && node.value[0] =~ /\A\/\*\*/ prev_comment = node.value[0] prev_comment = node else prev_comment = nil end elsif prev_comment @docs << { :comment => prev_comment, :linenr => 0, :comment => prev_comment.value[0], :linenr => prev_comment.line, :code => analyze_code(node), :type => :doc_comment, } Loading spec/css_sass_parser_spec.rb +4 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,10 @@ describe JsDuck::Css::SassParser do var[:comment].should == "/** My variable */" end it "detects line number" do var[:linenr].should == 1 end it "detects :css_var type" do var[:code][:tagname].should == :css_var end Loading Loading
lib/jsduck/css/sass_parser.rb +3 −3 Original line number Diff line number Diff line Loading @@ -28,14 +28,14 @@ module JsDuck nodes.each do |node| if node.class == Sass::Tree::CommentNode if node.type == :normal && node.value[0] =~ /\A\/\*\*/ prev_comment = node.value[0] prev_comment = node else prev_comment = nil end elsif prev_comment @docs << { :comment => prev_comment, :linenr => 0, :comment => prev_comment.value[0], :linenr => prev_comment.line, :code => analyze_code(node), :type => :doc_comment, } Loading
spec/css_sass_parser_spec.rb +4 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,10 @@ describe JsDuck::Css::SassParser do var[:comment].should == "/** My variable */" end it "detects line number" do var[:linenr].should == 1 end it "detects :css_var type" do var[:code][:tagname].should == :css_var end Loading