diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2024-09-09 12:21:33 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2024-09-09 12:27:50 +0800 |
commit | 24270bb7bdf004ef255e72a1ee9086df6f01df18 (patch) | |
tree | fef966d62a9d1ce13bad83b6ba548c20a9b95a02 /src/editor.mjs | |
parent | 724c9daa6b2319ad80fcae2dc61f8234bcbeee5e (diff) |
refactor: Apply API name for new vesion of mapclay
Diffstat (limited to 'src/editor.mjs')
-rw-r--r-- | src/editor.mjs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/editor.mjs b/src/editor.mjs index c011c6b..9c0f59b 100644 --- a/src/editor.mjs +++ b/src/editor.mjs | |||
@@ -1,6 +1,6 @@ | |||
1 | import TinyMDE from 'tiny-markdown-editor' | 1 | import TinyMDE from 'tiny-markdown-editor' |
2 | import { markdown2HTML, generateMaps } from './dumbymap' | 2 | import { markdown2HTML, generateMaps } from './dumbymap' |
3 | import { defaultAliasesForRenderer, parseConfigsFromText } from 'mapclay' | 3 | import { defaultAliasesForRenderer, parseConfigsFromYaml } from 'mapclay' |
4 | 4 | ||
5 | // Set up Editor {{{ | 5 | // Set up Editor {{{ |
6 | 6 | ||
@@ -104,7 +104,7 @@ const defaultApply = '/default.yml' | |||
104 | fetch(defaultApply) | 104 | fetch(defaultApply) |
105 | .then(res => res.text()) | 105 | .then(res => res.text()) |
106 | .then(rawText => { | 106 | .then(rawText => { |
107 | const config = parseConfigsFromText(rawText)?.at(0) | 107 | const config = parseConfigsFromYaml(rawText)?.at(0) |
108 | Object.assign(aliasesForMapOptions, config.aliases ?? {}) | 108 | Object.assign(aliasesForMapOptions, config.aliases ?? {}) |
109 | }) | 109 | }) |
110 | .catch(err => console.warn(`Fail to get aliases from ${defaultApply}`, err)) | 110 | .catch(err => console.warn(`Fail to get aliases from ${defaultApply}`, err)) |