History

Add SQL code highlighting in PostgreSQL documentation

Thibaut Courouble committed 10 years ago

Commit ca2d6821 parent 0b914903 files · +27 −1Browse files

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

Unified · Split

lib/docs/filters/postgresql/clean_html.rb+8−0
@@ -42,6 +42,14 @@ module Docs · 41 unmodified lines
4242 node.name = 'pre'
4343 node.content = node.content
4444 end
45+
46+ css('pre code', 'pre span').each do |node|
47+ node.before(node.children).remove
48+ end
49+
50+ css('pre.SYNOPSIS', 'pre.PROGRAMLISTING').each do |node|
51+ node['data-language'] = 'sql'
52+ end
4553 end
4654 end
4755 end