Unified · Split
| @@ -3,6 +3,10 @@ module Docs · 2 unmodified lines | ||
| 3 | 3 | class CleanHtmlFilter < Filter |
| 4 | 4 | def call |
| 5 | 5 | css('.links').remove |
| 6 | + css('pre').each do |node| | |
| 7 | + node.content = node.content | |
| 8 | + node['data-language'] = node['class'][/lang-(\w+)/, 1] | |
| 9 | + end | |
| 6 | 10 | doc |
| 7 | 11 | end |
| 8 | 12 | end |