Module: PublishingPlatformNokodiff::FormattingHelpers

Included in:
ChangesInFragments, TextNodeDiffs
Defined in:
lib/publishing_platform_nokodiff/formatting_helpers.rb

Instance Method Summary collapse

Instance Method Details

#highlight_changes(char, fragment) ⇒ Object



3
4
5
6
7
8
# File 'lib/publishing_platform_nokodiff/formatting_helpers.rb', line 3

def highlight_changes(char, fragment)
  Nokogiri::XML::Node.new("span", fragment.document).tap do |n|
    n.content = char
    n["class"] = "diff-marker"
  end
end