summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorChristoph (Sheogorath) Kern2018-06-01 13:49:09 +0200
committerGitHub2018-06-01 13:49:09 +0200
commit2ed2a08f6603cfdd144a4be9cfab0653f5e887d5 (patch)
tree3cda5d47ce02e84a4253eb26c56e92fdd7c59ebb /public
parent65544f9a18a2a418cd88d8fc9f8ee227bd4cf03c (diff)
parent7681076eb3380e3fc556b3c0503621d5025b7d50 (diff)
Merge pull request #782 from SISheogorath/feature/showFullTitle
Add title attribute in table of contents
Diffstat (limited to 'public')
-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 f93f7921..3457d465 100644
--- a/public/vendor/md-toc.js
+++ b/public/vendor/md-toc.js
@@ -54,6 +54,7 @@
var j = i + 1
this._elTitleElement = this.elTitleElements[i]
this._elTitleElementName = this._elTitleElement.tagName
+ this._elTitleElementTitle = this._elTitleElement.textContent.replace(/"/g, '"')
this._elTitleElementText = (typeof this.process === 'function' ? this.process(this._elTitleElement) : this._elTitleElement.innerHTML).replace(/<(?:.|\n)*?>/gm, '')
var id = this._elTitleElement.getAttribute('id')
if (!id) {
@@ -63,7 +64,7 @@
id = '#' + id
}
- this.tocContent += '<li><a href="' + id + '">' + this._elTitleElementText + '</a>'
+ this.tocContent += '<li><a href="' + id + '" title="'+ this._elTitleElementTitle +'">' + this._elTitleElementText + '</a>'
if (j !== this._elTitleElementsLen) {
this._elNextTitleElementName = this.elTitleElements[j].tagName