Skip to content

Commit

Permalink
fix: load JS for transformer plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
gera2ld committed Dec 19, 2024
1 parent f88108b commit c05aea9
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion mkdocs_markmap/static_files/mkdocs-markmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,25 @@
const assets = transformer.getAssets();
const loading = Promise.all([
assets.styles && markmap.loadCSS(assets.styles),
assets.scripts && markmap.loadJS(assets.scripts),
markmap.loadJS([
...transformer.plugins.flatMap(
(plugin) =>
plugin.config?.preloadScripts?.map((item) =>
item.data.src
? {
...item,
data: {
...item.data,
src: transformer.urlBuilder.getFullUrl(
item.data.src
),
},
}
: item
) || []
),
...(assets.scripts || []),
]),
]);

function parseData(content) {
Expand Down

0 comments on commit c05aea9

Please sign in to comment.