mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 07:34:42 -04:00
Fix header id and text might affects by mathjax tags
This commit is contained in:
parent
de2067f7e8
commit
ead48e45e0
2 changed files with 14 additions and 4 deletions
3
public/vendor/md-toc.js
vendored
Normal file → Executable file
3
public/vendor/md-toc.js
vendored
Normal file → Executable file
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue