diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-04-20 07:06:05 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-04-20 07:06:05 +0000 |
commit | 08b2e7cd8f69603075edcb93a6a66b6407beb700 (patch) | |
tree | 46fbdea6fafcf81ed1860b8b61efc24d782a9337 /lib/banzai | |
parent | 6e1069d57e77faaa20b8cd026a0239a7bfec4eb7 (diff) | |
parent | 0945dc4179abbf435a9b0aaf4482c94bd0368e35 (diff) | |
download | gitlab-ce-08b2e7cd8f69603075edcb93a6a66b6407beb700.tar.gz |
Merge branch 'plantuml-filter-after-highlight' into 'master'
Fix PlantUML integration in GFM
Closes #30557
See merge request !10651
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 |