diff --git a/lib/docs/filters/gcc/clean_html.rb b/lib/docs/filters/gcc/clean_html.rb new file mode 100644 index 00000000..14639b3e --- /dev/null +++ b/lib/docs/filters/gcc/clean_html.rb @@ -0,0 +1,12 @@ +module Docs + class Gcc + class CleanHtmlFilter < Filter + def call + css('pre').each do |node| + node['data-language'] = 'cpp' + end + doc + end + end + end +end diff --git a/lib/docs/scrapers/gnu/gcc.rb b/lib/docs/scrapers/gnu/gcc.rb index 565706d9..2aa9da39 100644 --- a/lib/docs/scrapers/gnu/gcc.rb +++ b/lib/docs/scrapers/gnu/gcc.rb @@ -6,7 +6,7 @@ module Docs home: 'https://gcc.gnu.org/' } - html_filters.push 'title' + html_filters.push 'gcc/clean_html', 'title' options[:root_title] = false options[:title] = false