File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,12 @@ def call
64
64
next_element . remove
65
65
node . add_child ( next_element )
66
66
end
67
+
68
+ # We changed this to a <pre> in parse(), changing it back here
69
+ node . name = 'div'
70
+ node . css ( '.grammar-literal' ) . each do |literal |
71
+ literal . name = 'code'
72
+ end
67
73
end
68
74
69
75
css ( '.grammar-railroad' ) . each do |node |
Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ def process_response?(response)
57
57
58
58
def parse ( response ) # Hook here because Nokogori removes whitespace from headings
59
59
response . body . gsub! %r{<h[1-6] class="code-header">} , '<pre class="code-header">'
60
+ # And the reference uses whitespace for indentation in grammar definitions
61
+ response . body . gsub! %r{<div class="grammar-container">([\W \w ]+?)</div>} , '<pre class="grammar-container">\1</pre>'
60
62
super
61
63
end
62
64
end
You can’t perform that action at this time.
0 commit comments