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

Commit

Permalink
Support Blockquotes 🍰
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyguitar committed Sep 2, 2016
1 parent d13dbb8 commit 77bebf2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
20 changes: 20 additions & 0 deletions lib/slide.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,26 @@ TerminalRenderer.prototype.hr = function() {
return '\n\n' + '-'.repeat(this.o.width) + '\n';
};

TerminalRenderer.prototype.blockquote = function(quoteBlocks) {
return Promise.all(quoteBlocks).then(quotes => {
var body = "";
quotes.forEach(quote => {
body += quote;
});
body = setLineSameWidth(body.trim());

var quote = "";
body.split('\n').forEach(line => {
if (line.trim() === "") {
quote += '\n';
return;
}
quote += ('> ' + line + '\n');
});
return '\n' + this.o.blockquote(indentify(quote)) + '\n\n';
});
};


/**
* Read slide content.
Expand Down
9 changes: 8 additions & 1 deletion slides/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ All pull requests are welcome!

---


### Noder JS

### Email: [email protected]
Expand Down Expand Up @@ -143,6 +142,14 @@ become
| zebra stripes | are neat | $1 |


# Block quote

> Blockquotes are very handy in email to emulate reply text.
> This line is part of the same quote.
> Oh, you can put Markdown into a blockquote.

# Link

Markdown
Expand Down

0 comments on commit 77bebf2

Please sign in to comment.