From 0a8e4b162878ca5210e18cfedd5bb0e8486f83dd Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 16 Jun 2015 18:28:28 +0000 Subject: [PATCH] Don't duplicate tags. git-svn-id: http://svn.redmine.org/redmine/trunk@14316 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/wiki_formatting/markdown/html_parser.rb | 8 +++----- lib/redmine/wiki_formatting/textile/html_parser.rb | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/redmine/wiki_formatting/markdown/html_parser.rb b/lib/redmine/wiki_formatting/markdown/html_parser.rb index e2dd1a78c..f81e389fb 100644 --- a/lib/redmine/wiki_formatting/markdown/html_parser.rb +++ b/lib/redmine/wiki_formatting/markdown/html_parser.rb @@ -20,21 +20,19 @@ module Redmine module Markdown class HtmlParser < Redmine::WikiFormatting::HtmlParser - self.tags = { + self.tags = tags.merge( 'b' => {:pre => '**', :post => '**'}, 'strong' => {:pre => '**', :post => '**'}, 'i' => {:pre => '_', :post => '_'}, 'em' => {:pre => '_', :post => '_'}, 'strike' => {:pre => '~~', :post => '~~'}, - 'br' => {:post => "\n"}, 'h1' => {:pre => "\n\n# ", :post => "\n\n"}, 'h2' => {:pre => "\n\n## ", :post => "\n\n"}, 'h3' => {:pre => "\n\n### ", :post => "\n\n"}, 'h4' => {:pre => "\n\n#### ", :post => "\n\n"}, 'h5' => {:pre => "\n\n##### ", :post => "\n\n"}, - 'h6' => {:pre => "\n\n###### ", :post => "\n\n"}, - 'style' => '' - } + 'h6' => {:pre => "\n\n###### ", :post => "\n\n"} + ) end end end diff --git a/lib/redmine/wiki_formatting/textile/html_parser.rb b/lib/redmine/wiki_formatting/textile/html_parser.rb index fba6b1d17..5e4ca763c 100644 --- a/lib/redmine/wiki_formatting/textile/html_parser.rb +++ b/lib/redmine/wiki_formatting/textile/html_parser.rb @@ -20,22 +20,20 @@ module Redmine module Textile class HtmlParser < Redmine::WikiFormatting::HtmlParser - self.tags = { + self.tags = tags.merge( 'b' => {:pre => '*', :post => '*'}, 'strong' => {:pre => '*', :post => '*'}, 'i' => {:pre => '_', :post => '_'}, 'em' => {:pre => '_', :post => '_'}, 'u' => {:pre => '+', :post => '+'}, 'strike' => {:pre => '-', :post => '-'}, - 'br' => {:post => "\n"}, 'h1' => {:pre => "\n\nh1. ", :post => "\n\n"}, 'h2' => {:pre => "\n\nh2. ", :post => "\n\n"}, 'h3' => {:pre => "\n\nh3. ", :post => "\n\n"}, 'h4' => {:pre => "\n\nh4. ", :post => "\n\n"}, 'h5' => {:pre => "\n\nh5. ", :post => "\n\n"}, - 'h6' => {:pre => "\n\nh6. ", :post => "\n\n"}, - 'style' => '' - } + 'h6' => {:pre => "\n\nh6. ", :post => "\n\n"} + ) end end end -- 2.39.5