lib/cl_wiki/format/format.graphviz.digraph.rb in clwiki-2.4.0 vs lib/cl_wiki/format/format.graphviz.digraph.rb in clwiki-3.0.0

- old
+ new

@@ -1,15 +1,16 @@ +# frozen_string_literal: true + class FormatGraphVizDiGraph < ClWiki::CustomFormatter - def FormatGraphVizDiGraph.match_re + def self.match_re /digraph.*\}/m end - - def FormatGraphVizDiGraph.format_content(content, page) + + def self.format_content(content, page) content.sub!(/digraph.*\}/m, - '<a href="dot.rb?fn=' + page.fileFullPathAndName + '">' + - '<img src="dot.rb?fn=' + page.fileFullPathAndName + '">' + - '</a>' - ) + "<a href=\"dot.rb?fn=#{page.file_full_path_and_name}\"> + <img src=\"dot.rb?fn=#{page.file_full_path_and_name}\"> + </a>") content end end ClWiki::CustomFormatters.instance.register(FormatGraphVizDiGraph)