From 16f6388785fcef1534aeb45c3e4dc9cfb1e1f860 Mon Sep 17 00:00:00 2001 From: Thibaut Date: Sun, 30 Nov 2014 11:27:55 -0500 Subject: [PATCH] Add PHP code highlighting --- assets/javascripts/views/pages/phpunit.coffee | 6 ++++++ lib/docs/filters/phpunit/clean_html.rb | 1 + 2 files changed, 7 insertions(+) create mode 100644 assets/javascripts/views/pages/phpunit.coffee diff --git a/assets/javascripts/views/pages/phpunit.coffee b/assets/javascripts/views/pages/phpunit.coffee new file mode 100644 index 00000000..f7f270ac --- /dev/null +++ b/assets/javascripts/views/pages/phpunit.coffee @@ -0,0 +1,6 @@ +#= require views/pages/base + +class app.views.PhpunitPage extends app.views.BasePage + afterRender: -> + @highlightCode @findAll('pre.programlisting'), 'php' + return diff --git a/lib/docs/filters/phpunit/clean_html.rb b/lib/docs/filters/phpunit/clean_html.rb index 58fea821..8f0761ce 100644 --- a/lib/docs/filters/phpunit/clean_html.rb +++ b/lib/docs/filters/phpunit/clean_html.rb @@ -45,6 +45,7 @@ module Docs next if node.previous_sibling && node.previous_sibling.content.present? next if node.next_sibling && node.next_sibling.content.present? node.parent.name = 'pre' + node.parent['class'] = 'programlisting' node.parent.content = node.content end