diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2024-10-11 17:12:31 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2024-10-11 17:33:01 +0800 |
commit | 7968922f416146c87d5d6aa4f6e415603d210424 (patch) | |
tree | 8e86f35b4368bf55aa7f8ec77361d82faff78af2 /src/dumbymap.mjs | |
parent | c2acb9473d4a19e7ad843ae026d762bf7a5d92e5 (diff) |
feat: update tutorial content for adding GeoLink
* add new module for hoding contents
* also add settings for linkify
Diffstat (limited to 'src/dumbymap.mjs')
-rw-r--r-- | src/dumbymap.mjs | 6 |
1 files changed, 5 insertions, 1 deletions
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) => { | |||
67 | return match | 67 | return match |
68 | }, | 68 | }, |
69 | } | 69 | } |
70 | const patterns = ['[', '(', '📍', '\uFF08', '@', 'geo:', 'twd'] | 70 | const patterns = ['[', '(', '📍', '\uFF08', '@', 'twd'] |
71 | patterns.forEach(prefix => | 71 | patterns.forEach(prefix => |
72 | md.linkify.add(prefix, coordinateValue), | 72 | md.linkify.add(prefix, coordinateValue), |
73 | ) | 73 | ) |
74 | md.linkify.add('geo:', { | ||
75 | validate: /(-?\d+\.?\d*),(-?\d+\.?\d*)/, | ||
76 | normalize: match => match, | ||
77 | }) | ||
74 | 78 | ||
75 | /** Custom rule for Blocks in DumbyMap */ | 79 | /** Custom rule for Blocks in DumbyMap */ |
76 | // FIXME A better way to generate blocks | 80 | // FIXME A better way to generate blocks |