From 7968922f416146c87d5d6aa4f6e415603d210424 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Fri, 11 Oct 2024 17:12:31 +0800 Subject: feat: update tutorial content for adding GeoLink * add new module for hoding contents * also add settings for linkify --- src/dumbymap.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/dumbymap.mjs') diff --git a/src/dumbymap.mjs b/src/dumbymap.mjs index 974d4a3..c39a62c 100644 --- a/src/dumbymap.mjs +++ b/src/dumbymap.mjs @@ -67,10 +67,14 @@ export const markdown2HTML = (container, mdContent) => { return match }, } - const patterns = ['[', '(', '📍', '\uFF08', '@', 'geo:', 'twd'] + const patterns = ['[', '(', '📍', '\uFF08', '@', 'twd'] patterns.forEach(prefix => md.linkify.add(prefix, coordinateValue), ) + md.linkify.add('geo:', { + validate: /(-?\d+\.?\d*),(-?\d+\.?\d*)/, + normalize: match => match, + }) /** Custom rule for Blocks in DumbyMap */ // FIXME A better way to generate blocks -- cgit v1.2.3-70-g09d2