History

Fix HTML filter for Julia 1.4+

Phil Scherer committed 5 years ago

Commit 17cbea71 parent 996fddb1 file · +9 −1Browse files

Showing the changes to lib/docs (1 of 1 file). Show all

Unified · Split

lib/docs/filters/julia/clean_html.rb+9−1
@@ -4,11 +4,19 @@ module Docs · 3 unmodified lines
4 def call4 def call
5 css('> header', '> footer').remove5 css('> header', '> footer').remove
6 6
7 # Julia 1.4+ uses different HTML
8 at_css('h1').content = at_css('h1').content
9
10 if at_css('#documenter-page')
11 @doc.children = at_css('#documenter-page').children
12 end
13 # End 1.4+ specific cleaning
14
7 css('.docstring', 'div:not([class])').each do |node|15 css('.docstring', 'div:not([class])').each do |node|
8 node.before(node.children).remove16 node.before(node.children).remove
9 end17 end
10 18
11 css('.docstring-header').each do |node|19 css('.docstring-header', 'header').each do |node|
12 node.name = 'h3'20 node.name = 'h3'
13 node.children.each { |child| child.remove if child.text? }21 node.children.each { |child| child.remove if child.text? }
14 node.remove_attribute('class')22 node.remove_attribute('class')

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t