1
0
Fork 0
mirror of https://github.com/marty-oehme/scripts.git synced 2024-11-18 07:48:07 +00:00

Merge pull request #39 from toindev/fix-insert-toc

Fix invalid chars pattern to allow numbers
This commit is contained in:
Patrizio Bekerle 2018-08-21 16:35:31 +02:00 committed by GitHub
commit 1cf129e5d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -4,7 +4,7 @@
"script": "insert-toc.qml",
"authors": ["@flopp", "@toindev"],
"platforms": ["linux", "macos", "windows"],
"version": "0.0.2",
"version": "0.0.3",
"minAppVersion": "17.06.2",
"description" : "This script scans the current note for headlines, generates a table of contents, and inserts a the TOC into the note."
}

View file

@ -47,7 +47,7 @@ Script {
function extractLink(title) {
var lowercase = title.toLowerCase()
var spaceReplaced = lowercase.replace(/ /g, "-")
var invalidCharsRemoved = spaceReplaced.replace(/[^A-Za-zÀ-ÿ-_]/g, "")
var invalidCharsRemoved = spaceReplaced.replace(/[^0-9A-Za-zÀ-ÿ-_]/g, "")
return invalidCharsRemoved;
}