Ver código fonte

Add PHP code highlighting

Thibaut 11 anos atrás
pai
commit
16f6388785

+ 6 - 0
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

+ 1 - 0
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