Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Commit

Permalink
Support HTML tag 🍰
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyguitar committed Sep 3, 2016
1 parent c544ff2 commit c2385a6
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/slide.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,16 @@ TerminalRenderer.prototype.blockquote = function(quoteBlocks) {
};

TerminalRenderer.prototype.html = function(html) {
return this.o.html(setLineSameWidth(html
.replace(/.*<pre>\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));
};


Expand Down
25 changes: 25 additions & 0 deletions slides/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,31 @@ become
> Oh, you can put Markdown into a blockquote.

# HTML

Markdown

```
<dl>
<dt>Definition list</dt>
<dd>Is something people use sometimes.</dd>
<dt>HTML in noslide</dt>
<dd>Does not work very well.</dd>
</dl>
```

become

<dl>
<dt>Definition list</dt>
<dd>Is something people use sometimes.</dd>

<dt>HTML in noslide</dt>
<dd>Does not work very well.</dd>
</dl>


# Link

Markdown
Expand Down

0 comments on commit c2385a6

Please sign in to comment.