class SCSSBeautifier::Formatters::SilentComment

Public Instance Methods

visit_comment(node) click to toggle source
# File lib/scss_beautifier/formatters/silent_comment.rb, line 2
def visit_comment(node)
  format_comment(node) if node.type == :normal
end

Private Instance Methods

format_comment(node) click to toggle source
# File lib/scss_beautifier/formatters/silent_comment.rb, line 8
def format_comment(node)
  # Remove /* from the beginning
  node.value.first.gsub!(/^\/\*/, "//")
  # Remove */ from the end
  node.value.last.gsub!(/\*\/$/, "")
  node.value.each do |item|
    item.gsub!(/\n/, "\n//") if String === item
  end
end