Skip to content

Commit

Permalink
Merge pull request #2090 from thewheat/cpp-add-support-for-sup-sub
Browse files Browse the repository at this point in the history
Fix CPP - Add support for super/subscript
  • Loading branch information
simon04 authored Jan 5, 2024
2 parents 9aac42c + 5660baa commit e098c4d
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 e098c4d

Please sign in to comment.