Fixing katex incompatibility

This commit is contained in:
Shan Carter
2017-04-13 12:52:59 -07:00
parent 7a5a9bbe74
commit c24a1d0485
3 changed files with 66 additions and 19 deletions
+11 -8
View File
@@ -51,16 +51,19 @@ function punctuation(text){
text = text.replace(/--/g, '\u2014');
text = text.replace(/ \u2014 /g,"\u2009\u2014\u2009"); //this has thin spaces
// The following are temporary commented out because incompatibility
// with katex
// Elipses
text = text.replace(/\.\.\./g,'…');
// text = text.replace(/\.\.\./g,'…');
// Nbsp for punc with spaces
var NBSP = "\u00a0";
var NBSP_PUNCTUATION_START = /([«¿¡]) /g;
var NBSP_PUNCTUATION_END = / ([\!\?:;\.,‽»])/g;
// var NBSP = "\u00a0";
// var NBSP_PUNCTUATION_START = /([«¿¡]) /g;
// var NBSP_PUNCTUATION_END = / ([\!\?:;\.,‽»])/g;
text = text.replace(NBSP_PUNCTUATION_START, '$1' + NBSP);
text = text.replace(NBSP_PUNCTUATION_END, NBSP + '$1');
// text = text.replace(NBSP_PUNCTUATION_START, '$1' + NBSP);
// text = text.replace(NBSP_PUNCTUATION_END, NBSP + '$1');
return text;
}
@@ -91,8 +94,8 @@ function quotes(text) {
function ligatures(text){
text = text.replace(/fi/g, 'fi');
text = text.replace(/fl/g, 'fl');
// text = text.replace(/fi/g, 'fi');
// text = text.replace(/fl/g, 'fl');
return text;
};