From ce45c0ab25522e70c85338f7108708bb00928182 Mon Sep 17 00:00:00 2001 From: PREVOST Romain Date: Tue, 21 Aug 2018 13:59:23 +0200 Subject: [PATCH] Fix invalid chars pattern to allow numbers --- insert-toc/info.json | 2 +- insert-toc/insert-toc.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/insert-toc/info.json b/insert-toc/info.json index ad19306..334dd97 100644 --- a/insert-toc/info.json +++ b/insert-toc/info.json @@ -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." } diff --git a/insert-toc/insert-toc.qml b/insert-toc/insert-toc.qml index 842038d..0ae768d 100644 --- a/insert-toc/insert-toc.qml +++ b/insert-toc/insert-toc.qml @@ -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; }