From c2385a6575bb91ed3a00c6f04af00c730cc6de78 Mon Sep 17 00:00:00 2001 From: chang-ning Date: Sat, 3 Sep 2016 08:41:16 +0800 Subject: [PATCH] Support HTML tag :cake: --- lib/slide.js | 13 ++++++++++--- slides/example.md | 25 +++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/lib/slide.js b/lib/slide.js index 0ff7c29..2af967c 100644 --- a/lib/slide.js +++ b/lib/slide.js @@ -213,9 +213,16 @@ TerminalRenderer.prototype.blockquote = function(quoteBlocks) { }; TerminalRenderer.prototype.html = function(html) { - return this.o.html(setLineSameWidth(html - .replace(/.*
\s```.*/g, '```')
-                                      .replace(/.*```\s<\/pre>.*/g,'```')));
+  var out = "";
+  if (html instanceof Array) {
+    html.forEach(block => {
+      out += block;
+    });
+  } else {
+    out = html;
+  }
+  out = out.replace(/<[^>\)\(]+>/g,'');
+  return this.o.html(setLineSameWidth(out));
 };
 
 
diff --git a/slides/example.md b/slides/example.md
index e19420d..b7530de 100644
--- a/slides/example.md
+++ b/slides/example.md
@@ -163,6 +163,31 @@ become
 > Oh, you can put Markdown into a blockquote. 
 
 
+# HTML
+
+Markdown
+
+```
+
+
Definition list
+
Is something people use sometimes.
+ +
HTML in noslide
+
Does not work very well.
+
+``` + +become + +
+
Definition list
+
Is something people use sometimes.
+ +
HTML in noslide
+
Does not work very well.
+
+ + # Link Markdown