Fixes #426.
Showing the changes to lib/docs (2 of 3 files). Show all
Unified · Split
| @@ -22,13 +22,15 @@ module Docs · 21 unmodified lines | |||
| 22 | end | 22 | end |
| 23 | 23 | ||
| 24 | css('h1', 'h2', 'h3', 'dt').each do |node| | 24 | css('h1', 'h2', 'h3', 'dt').each do |node| |
| 25 | links = node.css('a').remove | ||
| 25 | node.content = node.content | 26 | node.content = node.content |
| 27 | node << links | ||
| 26 | end | 28 | end |
| 27 | 29 | ||
| 28 | css('div[class^="highlight-"]').each do |node| | 30 | css('div[class^="highlight-"]').each do |node| |
| 29 | node.name = 'pre' | 31 | node.name = 'pre' |
| 30 | node['class'] = node['data-language'] = case node['class'] | 32 | node['class'] = node['data-language'] = case node['class'] |
| 31 | when 'highlight-python' then 'python' | 33 | when 'highlight-python', 'highlight-default' then 'python' |
| 32 | when 'highlight-html+django' then 'markup' | 34 | when 'highlight-html+django' then 'markup' |
| 33 | else '' | 35 | else '' |
| 34 | end | 36 | end |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | |||
| 2 | class Django | 2 | class Django |
| 3 | class FixUrlsFilter < Filter | 3 | class FixUrlsFilter < Filter |
| 4 | def call | 4 | def call |
| 5 | html.gsub! %r{#{Regexp.escape(Django.base_url)}([^"']+?)\.html}, "#{Django.base_url}\\1/" | 5 | html.gsub! %r{#{Regexp.escape(context[:base_url].to_s)}([^"']+?)\.html}, "#{context[:base_url]}\\1/" |
| 6 | html | 6 | html |
| 7 | end | 7 | end |
| 8 | end | 8 | end |