aboutsummaryrefslogtreecommitdiff
path: root/ext/js/data/anki-util.js
diff options
context:
space:
mode:
authorStefanVukovic99 <stefanvukovic44@gmail.com>2024-05-05 02:30:09 +0200
committerGitHub <noreply@github.com>2024-05-05 00:30:09 +0000
commit2d191bfdbd955a363e7afdc79c7a2b4b11a2e9b7 (patch)
treeeb3706b9ed98ba5347612088821ae046a0719fc8 /ext/js/data/anki-util.js
parentc3c5d58688a411c6ed450b89494c59037197df55 (diff)
add single dictionary handlebars (#814)24.5.5.0
* add single dictionary handlebars * fix dicts with kanji in title * sort * rename to single-glossary-XYZ * add brief and no dict variants * add docs, only terms no kanji * allow testing single dict handlebars * remove empty comment
Diffstat (limited to 'ext/js/data/anki-util.js')
-rw-r--r--ext/js/data/anki-util.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/js/data/anki-util.js b/ext/js/data/anki-util.js
index a063980f..c076c482 100644
--- a/ext/js/data/anki-util.js
+++ b/ext/js/data/anki-util.js
@@ -19,7 +19,7 @@
import {isObjectNotArray} from '../core/object-utilities.js';
/** @type {RegExp} @readonly */
-const markerPattern = /\{([\w-]+)\}/g;
+const markerPattern = /\{([\p{Letter}\p{Number}_-]+)\}/gu;
/**
* Gets the root deck name of a full deck name. If the deck is a root deck,
@@ -65,7 +65,7 @@ export function getFieldMarkers(string) {
* @returns {RegExp} A new `RegExp` instance.
*/
export function cloneFieldMarkerPattern(global) {
- return new RegExp(markerPattern.source, global ? 'g' : '');
+ return new RegExp(markerPattern.source, global ? 'gu' : 'u');
}
/**