mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
laravel: fix codes being squashed (fixes #1852)
This commit is contained in:
parent
0cc5933b7e
commit
2e236f5533
1 changed files with 10 additions and 3 deletions
|
@ -9,9 +9,16 @@ module Docs
|
|||
end
|
||||
|
||||
# Remove code highlighting
|
||||
css('pre').each do |node|
|
||||
node.content = node.content
|
||||
node['data-language'] = 'php'
|
||||
css('pre > code').each do |node|
|
||||
if node['data-lang'].eql?('nothing')
|
||||
# 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
|
||||
|
||||
doc
|
||||
|
|
Loading…
Reference in a new issue