Skip to content

Commit

Permalink
fixed #1757 マーメイド作成が動かなくなっている問題を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
kujirahand committed Oct 17, 2024
1 parent 9b68274 commit abd72f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/plugin_browser_dom_parts.mts
Original file line number Diff line number Diff line change
Expand Up @@ -473,17 +473,17 @@ export default {
pure: true,
asyncFn: true,
fn: async function (src: string, sys: any) {
console.log('aaa')
const div = sys.__exec('DOM部品作成', ['div', sys])
div.classList.add('mermaid')
div.innerHTML = src
// ライブラリを読み込む
if (typeof sys.__v0.WINDOW.mermaid === 'undefined') {
const win = sys.__getSysVar('WINDOW')
if (typeof win.mermaid === 'undefined') {
console.log('try to load mermaid')
await sys.__loadScript('https://cdn.jsdelivr.net/npm/[email protected]/dist/mermaid.min.js')
console.log('loaded mermaid')
console.log('mermaid.jsを読み込みました')
}
await sys.__v0.WINDOW.mermaid.run()
await win.mermaid.run()
return div
}
}
Expand Down

0 comments on commit abd72f6

Please sign in to comment.