Project

General

Profile

Feature #31231 » better-handling-of-html-tables.patch

patch (without tests) - Go MAEDA, 2019-04-20 09:57

View differences:

lib/redmine/wiki_formatting/html_parser.rb
30 30
      }
31 31

  
32 32
      def self.to_text(html)
33
        html = html.gsub(/[\n\r]/, '').squeeze(' ')
33
        html = html.gsub(/^\s+/, '').tr("\n\r", '').squeeze(' ')
34 34
    
35 35
        doc = Loofah.document(html)
36 36
        doc.scrub!(WikiTags.new(tags))
lib/redmine/wiki_formatting/markdown/html_parser.rb
34 34
          'h3' => {:pre => "\n\n### ", :post => "\n\n"},
35 35
          'h4' => {:pre => "\n\n#### ", :post => "\n\n"},
36 36
          'h5' => {:pre => "\n\n##### ", :post => "\n\n"},
37
          'h6' => {:pre => "\n\n###### ", :post => "\n\n"}
37
          'h6' => {:pre => "\n\n###### ", :post => "\n\n"},
38
          'th' => {:pre => '*', :post => "*\n"},
39
          'td' => {:pre => '', :post => "\n"}
38 40
        )
39 41
      end
40 42
    end
lib/redmine/wiki_formatting/textile/html_parser.rb
34 34
          'h3' => {:pre => "\n\nh3. ", :post => "\n\n"},
35 35
          'h4' => {:pre => "\n\nh4. ", :post => "\n\n"},
36 36
          'h5' => {:pre => "\n\nh5. ", :post => "\n\n"},
37
          'h6' => {:pre => "\n\nh6. ", :post => "\n\n"}
37
          'h6' => {:pre => "\n\nh6. ", :post => "\n\n"},
38
          'th' => {:pre => '*', :post => "*\n"},
39
          'td' => {:pre => '', :post => "\n"}
38 40
        )
39 41
      end
40 42
    end
(1-1/3)