laravel: fix codes being squashed (fixes #1852)

pull/1983/head
TK Lai 2 years ago
parent 0cc5933b7e
commit 2e236f5533

@ -9,9 +9,16 @@ module Docs
end end
# Remove code highlighting # Remove code highlighting
css('pre').each do |node| css('pre > code').each do |node|
node.content = node.content if node['data-lang'].eql?('nothing')
node['data-language'] = 'php' # Ignore 'nothing' language
else
node.parent['data-language'] = node['data-lang']
end
# Prism uses `\n` to determine lines. Otherwise the lines will be
# compacted.
node.parent.content = node.css('.line').map(&:content).join("\n")
node.remove
end end
doc doc

Loading…
Cancel
Save