MSzturc / obsidian-advanced-slides

Create markdown-based reveal.js presentations in Obsidian
https://mszturc.github.io/obsidian-advanced-slides/
MIT License
948 stars 80 forks source link

bug: ignores mermaid directives and YAML config #217

Open bguiz opened 1 year ago

bguiz commented 1 year ago

Describe the bug

Samples to Reproduce

This mermaid code block:

```mermaid
%%{init: { 'gitGraph': {'showBranches': false}} }%%
gitGraph
    commit id: "foo"
    commit id: "bar" type: HIGHLIGHT
    commit id: "baz"
```

renders the same as this:

```mermaid
gitGraph
    commit id: "foo"
    commit id: "bar" type: HIGHLIGHT
    commit id: "baz"
```

Essentially the mermaid directive for init.gitGraph.showBranches is ignored.

Also attempted to solve this in the YAML frontmatter, which I guessed may work if applied globally, to no avail:

---
transition: none
mermaid:
  init:
    gitGraph:
      showBranches: false
---

All of the above attempts render like this: actual behaviour screen shot

Expected behavior

I expect it to render like this, when init.gitGraph.showBranches=false

expected behaviour screen shot

mermaid live editor example

qrkourier commented 1 year ago

I see the same thing. Removing the comment %% Add more tasks as necessary in this Mermaid.js block allows Advanced Slides to render it correctly, but with the comment, I get this error.

Parse error on line 18: ...lors of the sectionssection Installatio -----------------------^ Expecting 'taskData', got 'NL'

    ```mermaid
gantt
    title share obsidian notes with zrok

    dateFormat  YYYY-MM-DD
    axisFormat  %m-%d

    section Installation
    Install cross-platform zrok install with Obsidian plugin              :done,    install10, 2023-04-01, 1d

    section Public Share
    Share entire vault                            :done,    public10, after install10, 1d
    Share exports folder                          :done,    public15, after public10, 1d
    Share selected folder                         :done,    public20, after public15, 1d
    Share selected note                           :done,    public30, after public20, 1d

    section Private Share
    Set up private share with authentication      :done,    private10, after public30, 2d

    %% Add more tasks as necessary

    %% Set the colors of the sections
    section Installation   #ff8080
    section Public Share   #ffc166
    section Private Share  #83c995
stannynuytkens commented 1 year ago

This is something essential for me to work out more advanced git graphs. The directives only work outside this (awesome) plugin!