Browse Source

switch default html to false (safer)

pull/768/head
Alex Deschamps 4 years ago
parent
commit
5ca58b4bde
  1. 2
      lib/presets/commonmark.js
  2. 8
      test/commonmark.js

2
lib/presets/commonmark.js

@ -5,7 +5,7 @@
module.exports = {
options: {
html: true, // Enable HTML tags in source
html: false, // Enable HTML tags in source
xhtmlOut: true, // Use '/' to close single tags (<br />)
breaks: false, // Convert '\n' in paragraphs into <br>
langPrefix: 'language-', // CSS language prefix for fenced blocks

8
test/commonmark.js

@ -33,3 +33,11 @@ describe('CommonMark', function () {
generate(p.join(__dirname, 'fixtures/commonmark/good.txt'), md);
});
describe('CommonMark defaults', function () {
var md = require('../')('commonmark');
it('defaults to the safe html false options', function () {
assert.strictEqual(md.render('<script>alert();</script>'), '<p>&lt;script&gt;alert();&lt;/script&gt;</p>\n');
});
});

Loading…
Cancel
Save