summaryrefslogtreecommitdiff
path: root/public/vendor
diff options
context:
space:
mode:
authorWu Cheng-Han2016-11-28 22:15:07 +0800
committerWu Cheng-Han2016-11-28 22:15:07 +0800
commitead48e45e0977e6376640b89f842f238ab382f94 (patch)
tree5cd8a54efb787a58b31c1c5c059f20423d5d05d8 /public/vendor
parentde2067f7e898f3557323782d28e8f7530ffb539f (diff)
Fix header id and text might affects by mathjax tags
Diffstat (limited to 'public/vendor')
-rwxr-xr-x[-rw-r--r--]public/vendor/md-toc.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/public/vendor/md-toc.js b/public/vendor/md-toc.js
index abdd9f56..200275a5 100644..100755
--- a/public/vendor/md-toc.js
+++ b/public/vendor/md-toc.js
@@ -13,6 +13,7 @@
this.ulClass = options['ulClass'];
this.tocTop = parseInt(options.top) || 0;
this.elChilds = this.el.children;
+ this.process = options['process'];
if (!this.elChilds.length) return;
this._init();
}
@@ -53,7 +54,7 @@
var j = i + 1;
this._elTitleElement = this.elTitleElements[i];
this._elTitleElementName = this._elTitleElement.tagName;
- this._elTitleElementText = this._elTitleElement.innerHTML.replace(/<(?:.|\n)*?>/gm, '');
+ this._elTitleElementText = (typeof this.process === 'function' ? this.process(this._elTitleElement) : this._elTitleElement.innerHTML).replace(/<(?:.|\n)*?>/gm, '');
var id = this._elTitleElement.getAttribute('id');
if (!id) {
this._elTitleElement.setAttribute('id', 'tip' + i);