Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Markdown extends Requestable {
* @return {Promise} - the promise for the http request
*/
render(options, cb) {
return this._request('POST', '/markdown', options, cb);
return this._request('POST', '/markdown', options, cb, true);
}
}

Expand Down
20 changes: 19 additions & 1 deletion test/dist.spec/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<script>mocha.setup('bdd')</script>
<script>
describe('the dist file', function() {
it('should work', function(done) {
it('should load a Gist', function(done) {
var github = new GitHub();
var gist = github.getGist('e265df71e7532f3a4bdd');
gist.read()
Expand All @@ -21,6 +21,24 @@
done();
});
});

it('should render markdown', function(done) {
var shouldBe = '<p>Hello world github/linguist#1 <strong>cool</strong>, and #1!</p>\n';
var github = new GitHub();
var markdown = github.getMarkdown();
const options = {
text: 'Hello world github/linguist#1 **cool**, and #1!',
};

markdown.render(options)
.then(function({data: html}) {
console.log(html);
if (html !== shouldBe) {
throw new Error(html + ' should be ' + shouldBe)
}
done();
}).catch(done);
});
});
</script>
<script>
Expand Down