obsidian-slides-extended icon indicating copy to clipboard operation
obsidian-slides-extended copied to clipboard

🐛 Error in rendering code blocks

Open tibomogul opened this issue 8 months ago • 7 comments

Input data (markdown source)

I am trying to use markdown to show code blocks:

Build the image
```bash
docker build . \
  --build-arg build_docker_uid=$(id -u) \
  --build-arg build_docker_gid=$(id -g) \
  -t tibomogul/api_property_pro
```

---

Image

You can see that unexpected

<!-- .slide: template="" -->
</div>

is in the preview

If you put in text right after the code block the error is not there

Build the image
```bash
docker build . \
  --build-arg build_docker_uid=$(id -u) \
  --build-arg build_docker_gid=$(id -g) \
  -t tibomogul/api_property_pro
```
h

---

Image

But if you have space the error will be back

Build the image
```bash
docker build . \
  --build-arg build_docker_uid=$(id -u) \
  --build-arg build_docker_gid=$(id -g) \
  -t tibomogul/api_property_pro
```


h

---

Image

Expected Behavior

No added

<!-- .slide: template="" -->
</div>

in the preview

Current behaviour

This

<!-- .slide: template="" -->
</div>

is present

Steps to reproduce

Try the markdown provided above

Which Operating Systems are you using?

  • [ ] Android
  • [ ] iPhone/iPad
  • [x] Linux
  • [ ] macOS
  • [ ] Windows

Obsidian Version

1.8.9

Slides Extended Plugin Version

2.1.10

Checks

  • [ ] I have tried it in the sandbox vault with only this plugin enabled

Possible solution

No response

tibomogul avatar Mar 28 '25 02:03 tibomogul

Interesting. I'm having trouble following what the error actually is.

Can you edit the above to surround your raw/markdown slide content with four backticks to make that more obvious?

ebullient avatar Mar 28 '25 13:03 ebullient

I have updated it, thanks!

tibomogul avatar Mar 28 '25 18:03 tibomogul

You have a default slide template set somewhere? I have never seen that behavior before.

(And thank you for clarifying/updating your issue. Much better!)

ebullient avatar Mar 29 '25 00:03 ebullient

I checked the settings, and saw that the Default Slide Theme and Default Highlight Theme had only the file basenames on them, without the extension. Re-selecting the options fixed most the issue.

Image

There is still the problem with an embedded javascript comment in markdown html code:

```html
    <script>
        /*** DATA START ***/

        // ...
        
        /*** DATA END ***/
    </script>
```

Image

tibomogul avatar Mar 30 '25 19:03 tibomogul

Image

With the same source, I only see this..

Are you defining a slide template anywhere (even in frontmatter)?

I'm not talking about the default slide/highlight theme, I'm literally talking about a slide template

ebullient avatar Mar 30 '25 20:03 ebullient

Ah, sorry, no I am not defining a slide template anywhere.

Started a new slide:

This is it
```html
<script>
/*** START ***/
/*** END ***/
</script>
```

Same as your result

Image

It seems the previous contents have an effect. I will try to get the minimal markdown to reproduce the bug and get back to you. Thanks for looking at this.

tibomogul avatar Mar 30 '25 21:03 tibomogul

I meant.. is the default template defined anywhere in your presentation .. not just in that one slide. The default slide comment doesn't (to my knowledge) just appear. I don't use them ever, so I'm not sure what the actual behavior is. It could be that the default template from the frontmatter is sprinkled everywhere.. which I think is super weird...

ebullient avatar Mar 31 '25 12:03 ebullient