Fix CPP - Add support for super/subscript
Unified · Split
| @@ -109,6 +109,16 @@ module Docs · 108 unmodified lines | |||
| 109 | node['src'] = node['src'].sub! %r{https://upload.cppreference.com/mwiki/(images/[^"']+?)}, 'http://upload.cppreference.com/mwiki/\1' | 109 | node['src'] = node['src'].sub! %r{https://upload.cppreference.com/mwiki/(images/[^"']+?)}, 'http://upload.cppreference.com/mwiki/\1' |
| 110 | end | 110 | end |
| 111 | 111 | ||
| 112 | css('.t-su.t-su-b').each do |node| | ||
| 113 | node.inner_html = node.inner_html.gsub('<br>', '') | ||
| 114 | node.name = 'sub' | ||
| 115 | end | ||
| 116 | |||
| 117 | css('.t-su:not(.t-su-b)').each do |node| | ||
| 118 | node.inner_html = node.inner_html.gsub('<br>', '') | ||
| 119 | node.name = 'sup' | ||
| 120 | end | ||
| 121 | |||
| 112 | # temporary solution due lack of mathjax/mathml support | 122 | # temporary solution due lack of mathjax/mathml support |
| 113 | css('.t-mfrac').each do |node| | 123 | css('.t-mfrac').each do |node| |
| 114 | fraction = Nokogiri::XML::Node.new('span', doc.document) | 124 | fraction = Nokogiri::XML::Node.new('span', doc.document) |