Allow some docs to be turned off so they are only visible in the code.

This commit is contained in:
Chris Eppstein 2010-03-16 18:39:56 -05:00
parent 1097e92ad3
commit c970ad3269
2 changed files with 4 additions and 1 deletions

View File

@ -97,7 +97,7 @@ def mixins(item)
comment = nil
sass_tree.children.each do |child|
if child.is_a?(Sass::Tree::MixinDefNode)
child.comment = comment
child.comment = comment && Sass::Tree::CommentNode.clean(comment)
comment = nil
mixins << child
elsif child.is_a?(Sass::Tree::CommentNode)

View File

@ -150,6 +150,9 @@ module Sass
attr_accessor :imported_filename unless method_defined? :imported_filename
end
class CommentNode < Node
def self.clean(docstring)
docstring.gsub(/@doc off(.*?)@doc on/m, '')
end
def docstring
([value] + lines).join("\n")
end