From c544ff2d6d51d934062c477bee36a5dd5eeacf0f Mon Sep 17 00:00:00 2001 From: chang-ning Date: Fri, 2 Sep 2016 23:56:51 +0800 Subject: [PATCH] Make pre tag support code --- lib/slide.js | 7 +++++++ slides/example.md | 2 ++ 2 files changed, 9 insertions(+) diff --git a/lib/slide.js b/lib/slide.js index 1113865..0ff7c29 100644 --- a/lib/slide.js +++ b/lib/slide.js @@ -212,6 +212,13 @@ TerminalRenderer.prototype.blockquote = function(quoteBlocks) { }); }; +TerminalRenderer.prototype.html = function(html) { + return this.o.html(setLineSameWidth(html + .replace(/.*
\s```.*/g, '```')
+                                      .replace(/.*```\s<\/pre>.*/g,'```')));
+};
+
+
 
 /**
  * Read slide content.
diff --git a/slides/example.md b/slides/example.md
index e2f5b38..e19420d 100644
--- a/slides/example.md
+++ b/slides/example.md
@@ -60,6 +60,7 @@ become
 
 Markdown
 
+
 ```
 var str = "Hello noslide.js!!! (>////<)"
 
@@ -70,6 +71,7 @@ request('http://www.google.com', function (error, response, body) {
   }
 })
 ```
+
become