From 4865a332ee5438204bf312050ebf300a645007da Mon Sep 17 00:00:00 2001 From: Yehonal Date: Tue, 23 May 2017 16:00:15 +0200 Subject: Create header id from text --- assets/js/wiki-features.js | 6 ++++++ 1 file changed, 6 insertions(+) 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) { -- cgit