Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Unified Diff: src/site/_plugins/prettify.rb

Issue 19291003: basic code highlighting for our docs (Closed) Base URL: git@github.com:dart-lang/dartlang.org.git@master
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/site/css/style.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/site/_plugins/prettify.rb
diff --git a/src/site/_plugins/prettify.rb b/src/site/_plugins/prettify.rb
index d0d36187a9e90f4fc992aced82d1520437402aa3..ed252056a7a0dd7541246c76a15e9d5641a877fe 100644
--- a/src/site/_plugins/prettify.rb
+++ b/src/site/_plugins/prettify.rb
@@ -31,7 +31,14 @@ module Prettify
unless @lang.nil?
out += ' lang-' + @lang
end
- out += '">' + CGI::escapeHTML(super) + "</pre>"
+ out += '">'
+
+ contents = super.strip
+ contents = CGI::escapeHTML(contents)
+ contents.gsub!('[[highlight]]', '<code class="nocode highlight">')
+ contents.gsub!('[[/highlight]]', '</code>')
+
+ out += contents + "</pre>"
end
end
« no previous file with comments | « no previous file | src/site/css/style.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698