Support for SmartyPants

This commit is contained in:
benweet 2013-10-05 19:18:38 +01:00
parent 5a0eab0bbb
commit 4c327ad586
5 changed files with 25 additions and 3 deletions

View File

@ -20,7 +20,7 @@
"bootstrap-tour": "~0.6.0",
"ace": "#51b7cb67a63998c9c0b7d089a85c60e032a7cc17",
"pagedown-ace": "git@github.com:benweet/pagedown-ace.git#master",
"pagedown-extra": "git@github.com:jmcmanus/pagedown-extra.git#e31cb17885ec5decc002d7fdf70535bde2e0ce0e",
"pagedown-extra": "git@github.com:jmcmanus/pagedown-extra.git#cca554948c362affb1cbab3bacc3861e2d90d426",
"crel": "git@github.com:KoryNunn/crel.git#8dbda04b129fc0aec01a2a080d1cab26816e11c1",
"waitForImages": "git@github.com:alexanderdickson/waitForImages.git#~1.4.2",
"to-markdown": "git@github.com:benweet/to-markdown.git#jquery",
@ -30,6 +30,6 @@
},
"resolutions": {
"jquery": "2.0.3",
"xregexp": "d06eff50f87d81d2dd3afc1e854784c38b17bcc4"
"pagedown-extra": "cca554948c362affb1cbab3bacc3861e2d90d426"
}
}

View File

@ -4,6 +4,7 @@ CACHE MANIFEST
CACHE:
index.html
viewer.html
res/worker.js
lib/MathJax/MathJax.js?config=TeX-AMS_HTML
lib/MathJax/config/Safe.js
lib/MathJax/config/TeX-AMS_HTML.js

View File

@ -32,6 +32,7 @@ define([
utils.setInputChecked("#input-markdownextra-deflist", hasExtension("def_list"));
utils.setInputChecked("#input-markdownextra-attrlist", hasExtension("attr_list"));
utils.setInputChecked("#input-markdownextra-footnotes", hasExtension("footnotes"));
utils.setInputChecked("#input-markdownextra-smartypants", hasExtension("smartypants"));
utils.setInputValue("#input-markdownextra-highlighter", markdownExtra.config.highlighter);
};
@ -42,6 +43,7 @@ define([
utils.getInputChecked("#input-markdownextra-deflist") && newConfig.extensions.push("def_list");
utils.getInputChecked("#input-markdownextra-attrlist") && newConfig.extensions.push("attr_list");
utils.getInputChecked("#input-markdownextra-footnotes") && newConfig.extensions.push("footnotes");
utils.getInputChecked("#input-markdownextra-smartypants") && newConfig.extensions.push("smartypants");
newConfig.highlighter = utils.getInputValue("#input-markdownextra-highlighter");
};

View File

@ -45,6 +45,15 @@
</div>
</div>
</div>
<div class="form-group">
<label class="col-lg-4 control-label"
for="input-markdownextra-smartypants">SmartyPants</label>
<div class="col-lg-7">
<div class="checkbox">
<input type="checkbox" id="input-markdownextra-smartypants">
</div>
</div>
</div>
<div class="form-group">
<label class="col-lg-4 control-label"
for="input-markdownextra-highlighter">Syntax highlighter</label>

View File

@ -158,7 +158,7 @@ define([
// Upgrade from v9 to v10
if(version == "v9") {
if(_.has(localStorage, 'settings')) {
settings = JSON.parse(localStorage.settings);
var settings = JSON.parse(localStorage.settings);
delete settings.editorFontFamily;
delete settings.editorFontSize;
settings.template && (settings.template = settings.template.replace('http://benweet.github.io/stackedit/css/main-min.css', 'http://benweet.github.io/stackedit/res-min/themes/default.css'));
@ -167,5 +167,15 @@ define([
version = "v10";
}
// Upgrade from v10 to v11
if(version == "v10") {
if(_.has(localStorage, 'settings')) {
var settings = JSON.parse(localStorage.settings);
settings.extensionSettings && settings.extensionSettings.markdownExtra && settings.extensionSettings.markdownExtra.extensions && settings.extensionSettings.markdownExtra.extensions.push('smartypants');
localStorage.settings = JSON.stringify(settings);
}
version = "v11";
}
localStorage["version"] = version;
});