about summary refs log tree commit diff
path: root/doc/tutorial/lib/markdown.js
diff options
context:
space:
mode:
authorMarijn Haverbeke <marijnh@gmail.com>2011-11-01 12:26:17 +0100
committerMarijn Haverbeke <marijnh@gmail.com>2011-11-01 12:46:46 +0100
commite8e2cd44f48a6edcdd4477ab66f0fc5935ecd1a1 (patch)
tree26c4cf692d124b6bbefc10b9a17b3e9e06044855 /doc/tutorial/lib/markdown.js
parent8b57cb90e50b600824c967470483462aeb663e50 (diff)
downloadrust-e8e2cd44f48a6edcdd4477ab66f0fc5935ecd1a1.tar.gz
rust-e8e2cd44f48a6edcdd4477ab66f0fc5935ecd1a1.zip
Add syntax highlighting to the code snippets in the tutorial
Using the CodeMirror Rust mode.
Diffstat (limited to 'doc/tutorial/lib/markdown.js')
-rw-r--r--doc/tutorial/lib/markdown.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/doc/tutorial/lib/markdown.js b/doc/tutorial/lib/markdown.js
index f19d0529953..4d3bfaeb77f 100644
--- a/doc/tutorial/lib/markdown.js
+++ b/doc/tutorial/lib/markdown.js
@@ -252,8 +252,6 @@ Markdown.prototype.toTree = function toTree( source, custom_root ) {
 Markdown.prototype.debug = function () {
   var args = Array.prototype.slice.call( arguments);
   args.unshift(this.debug_indent);
-  if (typeof print !== "undefined")
-      print.apply( print, args );
   if (typeof console !== "undefined" && typeof console.log !== "undefined")
       console.log.apply( null, args );
 }
@@ -1125,6 +1123,10 @@ Markdown.dialects.Maruku.block.definition_list = function definition_list( block
   return [ list ];
 }
 
+Markdown.dialects.Maruku.block.html_paragraph = function html_paragraph( block, next ) {
+  if (block.match(/^<\w/)) return [["RAW", block.toString()]];
+}
+
 Markdown.dialects.Maruku.inline[ "{:" ] = function inline_meta( text, matches, out ) {
   if ( !out.length ) {
     return [ 2, "{:" ];
@@ -1297,6 +1299,7 @@ function render_tree( jsonml ) {
   var tag = jsonml.shift(),
       attributes = {},
       content = [];
+  if (tag == "RAW") return jsonml[0];
 
   if ( jsonml.length && typeof jsonml[ 0 ] === "object" && !( jsonml[ 0 ] instanceof Array ) ) {
     attributes = jsonml.shift();