diff --git a/doc-src/lib/stylesheets.rb b/doc-src/lib/stylesheets.rb index eb28d75b..7a73e85f 100644 --- a/doc-src/lib/stylesheets.rb +++ b/doc-src/lib/stylesheets.rb @@ -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) diff --git a/doc-src/lib/stylesheets/sass_extensions.rb b/doc-src/lib/stylesheets/sass_extensions.rb index 907155b7..3be479fa 100644 --- a/doc-src/lib/stylesheets/sass_extensions.rb +++ b/doc-src/lib/stylesheets/sass_extensions.rb @@ -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