diff options
| author | Hsieh Chin Fan <pham@topo.tw> | 2024-09-21 19:11:51 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <pham@topo.tw> | 2024-09-22 00:46:50 +0800 |
| commit | 3ae190d96ac3624d30f6bfe5ebb63f6d2426c055 (patch) | |
| tree | 053d21bdd0400719ee9e3e1c7356bb73a5fff478 /src | |
| parent | 6a2927200f5caa418cfcb16433c92b6acbec61c6 (diff) | |
fix: 5d0a91d, should handle default aliases now
Diffstat (limited to 'src')
| -rw-r--r-- | src/dumbymap.mjs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/dumbymap.mjs b/src/dumbymap.mjs index 849303b..a785d6f 100644 --- a/src/dumbymap.mjs +++ b/src/dumbymap.mjs | |||
| @@ -4,7 +4,7 @@ import MarkdownItFootnote from 'markdown-it-footnote' | |||
| 4 | import MarkdownItFrontMatter from 'markdown-it-front-matter' | 4 | import MarkdownItFrontMatter from 'markdown-it-front-matter' |
| 5 | import MarkdownItTocDoneRight from 'markdown-it-toc-done-right' | 5 | import MarkdownItTocDoneRight from 'markdown-it-toc-done-right' |
| 6 | import LeaderLine from 'leader-line' | 6 | import LeaderLine from 'leader-line' |
| 7 | import { renderWith, parseConfigsFromYaml } from 'mapclay' | 7 | import { renderWith, defaultAliases, parseConfigsFromYaml } from 'mapclay' |
| 8 | import { onRemove, animateRectTransition, throttle } from './utils' | 8 | import { onRemove, animateRectTransition, throttle } from './utils' |
| 9 | import { Layout, OverlayLayout } from './Layout' | 9 | import { Layout, OverlayLayout } from './Layout' |
| 10 | 10 | ||
| @@ -414,7 +414,14 @@ export const generateMaps = async (container, callback) => { | |||
| 414 | 414 | ||
| 415 | // Render each code block with "language-map" class | 415 | // Render each code block with "language-map" class |
| 416 | const elementsWithMapConfig = Array.from(container.querySelectorAll('pre:has(.language-map)') ?? []) | 416 | const elementsWithMapConfig = Array.from(container.querySelectorAll('pre:has(.language-map)') ?? []) |
| 417 | const render = renderWith(config => ({ width: "100%", ...config })) | 417 | const render = renderWith(config => ({ |
| 418 | width: "100%", | ||
| 419 | ...config, | ||
| 420 | aliases: { | ||
| 421 | ...defaultAliases, | ||
| 422 | ...config.aliases ?? {} | ||
| 423 | }, | ||
| 424 | })) | ||
| 418 | const renderTargets = elementsWithMapConfig | 425 | const renderTargets = elementsWithMapConfig |
| 419 | .map(async (target) => { | 426 | .map(async (target) => { |
| 420 | // Get text in code block starts with '```map' | 427 | // Get text in code block starts with '```map' |