From 4c2288d3caa2fc2884fc946642f28b2c672134db Mon Sep 17 00:00:00 2001 From: "Kyle E. Mitchell" Date: Sun, 7 Mar 2021 22:01:54 -0800 Subject: [PATCH] Test typographer option switches --- test/misc.js | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/test/misc.js b/test/misc.js index e71ad35..5d51a72 100644 --- a/test/misc.js +++ b/test/misc.js @@ -359,6 +359,53 @@ describe('smartquotes', function () { }); +describe('typographer switches', function () { + + it('Should support disabling IP symbols', function () { + var md = markdownit({ + typographer: { + quotes: true, + rare: true, + intellectualProperty: false + } + }); + assert.strictEqual( + md.render('(P) means "phonogram"!!!!!!'), + '

(P) means “phonogram”!!!

\n' + ); + }); + + it('Should support disabling quote replacements', function () { + var md = markdownit({ + typographer: { + quotes: false, + rare: true, + intellectualProperty: true + } + }); + assert.strictEqual( + md.render('Should\'ve registered that (c)!!!!!!'), + '

Should\'ve registered that ©!!!

\n' + ); + }); + + it('Should support disabling rare replacements', function () { + var md = markdownit({ + typographer: { + quotes: true, + rare: false, + intellectualProperty: true + } + }); + assert.strictEqual( + md.render('Definitely should\'ve registered that (c)!!!!!!'), + '

Definitely should’ve registered that ©!!!!!!

\n' + ); + }); + +}); + + describe('Token attributes', function () { it('.attrJoin', function () { var md = markdownit();