From 8a67cb3a83696f8b081a3027af2639d3f22e8188 Mon Sep 17 00:00:00 2001 From: Vitaly Puzrin Date: Sat, 20 Dec 2014 12:24:53 +0300 Subject: [PATCH] Do browserified output ascii-friendly --- Makefile | 2 +- lib/presets/commonmark.js | 2 +- lib/presets/default.js | 2 +- lib/presets/full.js | 2 +- lib/renderer.js | 2 +- lib/rules_core/smartquotes.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 613e9c7..1546f32 100644 --- a/Makefile +++ b/Makefile @@ -72,7 +72,7 @@ browserify: browserify -r ./ -s markdownit \ ) > dist/markdown-it.js # Minify - uglifyjs dist/markdown-it.js -c -m \ + uglifyjs dist/markdown-it.js -b beautify=false,ascii-only=true -c -m \ --preamble "/*! ${NPM_PACKAGE} ${NPM_VERSION} ${GITHUB_PROJ} @license MIT */" \ > dist/markdown-it.min.js diff --git a/lib/presets/commonmark.js b/lib/presets/commonmark.js index 43483fd..2c4b1e3 100644 --- a/lib/presets/commonmark.js +++ b/lib/presets/commonmark.js @@ -16,7 +16,7 @@ module.exports = { // Double + single quotes replacement pairs, when typographer enabled, // and smartquotes on. Set doubles to '«»' for Russian, '„“' for German. - quotes: '“”‘’', + quotes: '\u201c\u201d\u2018\u2019' /* “”‘’ */, // Highlighter function. Should return escaped HTML, // or '' if input not changed diff --git a/lib/presets/default.js b/lib/presets/default.js index ca9bf56..bb979b8 100644 --- a/lib/presets/default.js +++ b/lib/presets/default.js @@ -16,7 +16,7 @@ module.exports = { // Double + single quotes replacement pairs, when typographer enabled, // and smartquotes on. Set doubles to '«»' for Russian, '„“' for German. - quotes: '“”‘’', + quotes: '\u201c\u201d\u2018\u2019' /* “”‘’ */, // Highlighter function. Should return escaped HTML, // or '' if input not changed diff --git a/lib/presets/full.js b/lib/presets/full.js index 6e92668..a0c231c 100644 --- a/lib/presets/full.js +++ b/lib/presets/full.js @@ -16,7 +16,7 @@ module.exports = { // Double + single quotes replacement pairs, when typographer enabled, // and smartquotes on. Set doubles to '«»' for Russian, '„“' for German. - quotes: '“”‘’', + quotes: '\u201c\u201d\u2018\u2019' /* “”‘’ */, // Highlighter function. Should return escaped HTML, // or '' if input not changed diff --git a/lib/renderer.js b/lib/renderer.js index 52205ca..b711581 100644 --- a/lib/renderer.js +++ b/lib/renderer.js @@ -307,7 +307,7 @@ rules.footnote_anchor = function (tokens, idx) { if (tokens[idx].subId > 0) { id += ':' + tokens[idx].subId; } - return ' '; + return ' \u21a9'; /* ↩ */ }; diff --git a/lib/rules_core/smartquotes.js b/lib/rules_core/smartquotes.js index 12a2e93..05a954d 100644 --- a/lib/rules_core/smartquotes.js +++ b/lib/rules_core/smartquotes.js @@ -6,7 +6,7 @@ var QUOTE_TEST_RE = /['"]/; var QUOTE_RE = /['"]/g; var PUNCT_RE = /[-\s()\[\]]/; -var APOSTROPHE = '’'; +var APOSTROPHE = '\u2019'; /* ’ */ // This function returns true if the character at `pos` // could be inside a word.