Skip to content

Commit

Permalink
Fix CPP - Add support for super/subscript
Browse files Browse the repository at this point in the history
  • Loading branch information
thewheat committed Oct 23, 2023
1 parent 887c879 commit 5660baa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/docs/filters/cppref/clean_html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@ def call
node['src'] = node['src'].sub! %r{https://upload.cppreference.com/mwiki/(images/[^"']+?)}, 'http://upload.cppreference.com/mwiki/\1'
end

css('.t-su.t-su-b').each do |node|
node.inner_html = node.inner_html.gsub('<br>', '')
node.name = 'sub'
end

css('.t-su:not(.t-su-b)').each do |node|
node.inner_html = node.inner_html.gsub('<br>', '')
node.name = 'sup'
end

# temporary solution due lack of mathjax/mathml support
css('.t-mfrac').each do |node|
fraction = Nokogiri::XML::Node.new('span', doc.document)
Expand Down

0 comments on commit 5660baa

Please sign in to comment.