lynchjames / obsidian-mind-map

An Obsidian plugin for displaying markdown notes as mind maps using Markmap.
MIT License
1.05k stars 73 forks source link

Mindmap stops rendering when page has a Codeblock with unknown language #23

Open ggarcia24 opened 3 years ago

ggarcia24 commented 3 years ago

Hello,

First of all, thank you very much for creating this plugin is has been really usefull 😄. I think I've found an issue with code blocks:

I'm currently having a page that looks like the following:

# H1

Text

## H2

- This is something

## H2

- This is something

## H2

- This is something

If I add a code block with JSON language in the file the Mindmap window stops rendering


# H1

Text 

```json
{
   "a": "b"
}
``` # 
... (rest of the file)

The following error appears in the console:

index.js:44 Uncaught (in promise) TypeError: require.resolve is not a function
    at eval (eval at <anonymous> (app.js:1), <anonymous>:27101:32)
    at handleId (eval at <anonymous> (app.js:1), <anonymous>:26880:13)
    at loadComponentsInOrder (eval at <anonymous> (app.js:1), <anonymous>:26902:4)
    at Object.load (eval at <anonymous> (app.js:1), <anonymous>:27048:12)
    at loadLanguages (eval at <anonymous> (app.js:1), <anonymous>:27090:48)
    at Function.highlight (eval at <anonymous> (app.js:1), <anonymous>:27184:11)
    at Object.rules.fence (eval at <anonymous> (app.js:1), <anonymous>:2518:37)
    at Renderer.render (eval at <anonymous> (app.js:1), <anonymous>:2925:39)
    at buildTree (eval at <anonymous> (app.js:1), <anonymous>:27348:32)
    at transform$2 (eval at <anonymous> (app.js:1), <anonymous>:27391:14)

This is really weird because obsidian is rendering correctly the code block (highlighting with JSON syntax) but Mindmap cannot, it needs to have a js lang or no lang at all

HickmannLautaro commented 3 years ago

I have the same problem, if I copy the markdown to the markmap live demo it works as expected but in the obsidian plugin nothing is shown.

jw0z commented 3 years ago

Probably the same issue as #25