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
6464 next_element . remove
6565 node . add_child ( next_element )
6666 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
6773 end
6874
6975 css ( '.grammar-railroad' ) . each do |node |
Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ def process_response?(response)
5757
5858 def parse ( response ) # Hook here because Nokogori removes whitespace from headings
5959 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>'
6062 super
6163 end
6264 end
You can’t perform that action at this time.
0 commit comments