aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/editor.mjs
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2024-10-12 15:46:50 +0800
committerHsieh Chin Fan <pham@topo.tw>2024-10-12 16:44:28 +0800
commit72704e3f5d5f4cbe00640be875955d4649f30780 (patch)
tree7571e0ddbf006cdd1e1b9b37fa43ddd089ee03b8 /src/editor.mjs
parent49b0b5eeab42fbd93bd2458c32c6170ab3edd0bf (diff)
feat: use selection as default name of anchor
Diffstat (limited to 'src/editor.mjs')
-rw-r--r--src/editor.mjs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/editor.mjs b/src/editor.mjs
index fd18f78..5a51fbe 100644
--- a/src/editor.mjs
+++ b/src/editor.mjs
@@ -1124,7 +1124,12 @@ dumbyContainer.onmousedown = (e) => {
1124 return 1124 return
1125 } 1125 }
1126 1126
1127 const refLink = addAnchorByPoint({ point: e, map, validateAnchorName }) 1127 const refLink = addAnchorByPoint({
1128 defaultName: geoLink.textContent,
1129 point: e,
1130 map,
1131 validateAnchorName,
1132 })
1128 if (!refLink) { 1133 if (!refLink) {
1129 resumeContent() 1134 resumeContent()
1130 return 1135 return