Skip to content

Commit 09384e3

Browse files
j-rewertsclayreimann
authored andcommitted
Fix browser markdown (#548)
Got the code from PR #505. Fixes #451.
1 parent ee64cd1 commit 09384e3

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

lib/Markdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Markdown extends Requestable {
3232
* @return {Promise} - the promise for the http request
3333
*/
3434
render(options, cb) {
35-
return this._request('POST', '/markdown', options, cb);
35+
return this._request('POST', '/markdown', options, cb, true);
3636
}
3737
}
3838

test/dist.spec/index.html

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<script>mocha.setup('bdd')</script>
1313
<script>
1414
describe('the dist file', function() {
15-
it('should work', function(done) {
15+
it('should load a Gist', function(done) {
1616
var github = new GitHub();
1717
var gist = github.getGist('e265df71e7532f3a4bdd');
1818
gist.read()
@@ -21,6 +21,24 @@
2121
done();
2222
});
2323
});
24+
25+
it('should render markdown', function(done) {
26+
var shouldBe = '<p>Hello world github/linguist#1 <strong>cool</strong>, and #1!</p>\n';
27+
var github = new GitHub();
28+
var markdown = github.getMarkdown();
29+
const options = {
30+
text: 'Hello world github/linguist#1 **cool**, and #1!',
31+
};
32+
33+
markdown.render(options)
34+
.then(function({data: html}) {
35+
console.log(html);
36+
if (html !== shouldBe) {
37+
throw new Error(html + ' should be ' + shouldBe)
38+
}
39+
done();
40+
}).catch(done);
41+
});
2442
});
2543
</script>
2644
<script>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy