diff options
author | Adam Niedzielski <adamsunday@gmail.com> | 2017-04-19 17:54:58 +0200 |
---|---|---|
committer | Adam Niedzielski <adamsunday@gmail.com> | 2017-04-19 17:54:58 +0200 |
commit | 0945dc4179abbf435a9b0aaf4482c94bd0368e35 (patch) | |
tree | fad1a0bc90f4840600187b66d3d0778ee2da2811 /lib/banzai | |
parent | a9446a279ad88169663cc4effb93c26426901a6a (diff) | |
download | gitlab-ce-0945dc4179abbf435a9b0aaf4482c94bd0368e35.tar.gz |
Fix PlantUML integration in GFMplantuml-filter-after-highlight
Fixes #30557
Use "lang" attribute instead of "class" in PlantumlFilter.
Diffstat (limited to 'lib/banzai')
-rw-r--r-- | lib/banzai/filter/plantuml_filter.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/banzai/filter/plantuml_filter.rb b/lib/banzai/filter/plantuml_filter.rb index b2537117558..5325819d828 100644 --- a/lib/banzai/filter/plantuml_filter.rb +++ b/lib/banzai/filter/plantuml_filter.rb @@ -7,14 +7,14 @@ module Banzai # class PlantumlFilter < HTML::Pipeline::Filter def call - return doc unless doc.at('pre.plantuml') && settings.plantuml_enabled + return doc unless doc.at('pre > code[lang="plantuml"]') && settings.plantuml_enabled plantuml_setup - doc.css('pre.plantuml').each do |el| + doc.css('pre > code[lang="plantuml"]').each do |node| img_tag = Nokogiri::HTML::DocumentFragment.parse( - Asciidoctor::PlantUml::Processor.plantuml_content(el.content, {})) - el.replace img_tag + Asciidoctor::PlantUml::Processor.plantuml_content(node.content, {})) + node.parent.replace(img_tag) end doc |