lib/jekyll-diagrams/plantuml.rb in jekyll-diagrams-0.9.1 vs lib/jekyll-diagrams/plantuml.rb in jekyll-diagrams-0.9.2

- old
+ new

@@ -1,22 +1,26 @@ +# frozen_string_literal: true + module Jekyll module Diagrams class PlantUMLBlock < Block + XML_REGEX = /^<\?xml([^>]|\n)*>\n?/.freeze + def render_svg(code, config) command = build_command(config) svg = render_with_stdin_stdout(command, code) - svg.sub!(/^<\?xml([^>]|\n)*>\n?/, '') + svg.sub!(XML_REGEX, '') end - def build_command(config) - options = 'java' + def build_command(_config) + options = +'java' options << ' -Djava.awt.headless=true' options << ' -jar ' options << vendor_path('plantuml.1.2020.1.jar') options << ' -tsvg -pipe' end end end end -Liquid::Template.register_tag(:plantuml, Jekyll::Diagrams::PlantUMLBlock) \ No newline at end of file +Liquid::Template.register_tag(:plantuml, Jekyll::Diagrams::PlantUMLBlock)