summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorYehonal <yehonal.azeroth@gmail.com>2017-05-23 16:00:15 +0200
committerGitHub <noreply@github.com>2017-05-23 16:00:15 +0200
commit4865a332ee5438204bf312050ebf300a645007da (patch)
treed13fccffea41a6d5f45ab305bce75f8c34a84905 /assets
parent6861bd62021e7c6e368b484e48770fffb260e304 (diff)
downloadwiki-4865a332ee5438204bf312050ebf300a645007da.tar.gz
wiki-4865a332ee5438204bf312050ebf300a645007da.tar.bz2
wiki-4865a332ee5438204bf312050ebf300a645007da.zip
Create header id from text
Diffstat (limited to 'assets')
-rw-r--r--assets/js/wiki-features.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/assets/js/wiki-features.js b/assets/js/wiki-features.js
index bb35cd3..237bf05 100644
--- a/assets/js/wiki-features.js
+++ b/assets/js/wiki-features.js
@@ -33,6 +33,12 @@
if (!this.id && previousSiblingName) {
this.id = $(this).attr( "id", previousSiblingName.replace(/\./g, "-") );
}
+
+ // Yehonal
+ if (!this.id) {
+ this.id = $(this).text().replace(/\W/g,'_');
+ }
+
return this.id;
}), output = $(this);
if (!headers.length || headers.length < settings.minimumHeaders || !output.length) {