Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Nested Codeblocks #92

Closed
Aetherinox opened this issue Aug 17, 2023 · 9 comments
Closed

Bug: Nested Codeblocks #92

Aetherinox opened this issue Aug 17, 2023 · 9 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed needs info More information is required needs repro Needs reproduction reading mode Relevant to Obsidian reading mode

Comments

@Aetherinox
Copy link

Aetherinox commented Aug 17, 2023

Describe the bug

When attempting to nest codeblocks, editing mode displays the codeblock correctly. However, Live mode displays a blank codeblock.

Steps to reproduce

In the example below, I keep examples for the dataview plugin in a document. The outer codeblock formats as markdown using an extra tick. Then the inner code is the actual dataview code.

````markdown
```dataview
table list(file.ctime.day,file.ctime.month) as creation
```
````

Expected behaviour

Nested codeblocks should appear the same in Edit and Live modes.

Current behaviour

Edit Mode works properly and displays the nested codeblocks
Live Mode displays a blank codeblock

Environment

  • Plugin Version: v1.0.7
  • Obsidian Version: v1.3.7
  • Platform: Desktop
  • OS: Windows 11 Pro
  • Theme: Blue Topaz
  • CSS Snippets: No

Screenshots

Edit Mode
obsid_edit

Live Mode
obsid_live

Additional context

Once this plugin is disabled, nested codeblocks function properly in edit and live modes.

@Aetherinox Aetherinox added the bug Something isn't working label Aug 17, 2023
@mayurankv
Copy link
Owner

Thanks for the bug report, will look into it.

@mayurankv mayurankv added future work To develop into the plugin reading mode Relevant to Obsidian reading mode needs repro Needs reproduction labels Aug 18, 2023
@mayurankv
Copy link
Owner

Hey I can't reproduce this unfortunately. I actually need to fix a non-trivial problem before the next release so I don't know whether something small I've changed between releases could have fixed this but I doubt it. Does this issue still occur in a new vault?

@Aetherinox
Copy link
Author

So, this is a rather odd bug.

The day I reported it, it lasted the entire day. I actually had to cease working on what I was doing in regards to needing nested codeblocks because it refused to work.

I went back today to work on it again, and the code was there. I've tried to break it every which way I can and it appears to be working properly.

The only thing I can equate it to is possibly another plugin was conflicting with it somehow. The bad issue with that, is I legit change plugins every single day. I install a few new ones, and remove a few I no longer need.

At the time of writing this, I currently have 89 plugins installed. So I'm going to have to do a vault backup, and then go back through the list and see if I can somehow at least narrow down where it was coming from. But I know it was an issue because I spent a good hour trying to figure out why the text was disappearing, even going as far to use the developer console and see if it was at least being inserted, or if it was just marked with something like display:none;, and it wasn't, it was just flat out missing from the HTML as soon as I switched modes.

@mayurankv
Copy link
Owner

Ok that is very weird. I'm trying to do a quick refactor with the next version to make things slightly less buggy.

This could also be related to #91 though in that case the reading mode was kind of being ignored. I have come across cases where this weird behaviour happens but I'm actually unaware of it still being an issue. Though despite all that, as I said I hope to change some stuff to make it less buggy soon.

If you do get a chance and narrow down a plugin conflict or something, that would be super helpful!

@mayurankv mayurankv added help wanted Extra attention is needed needs info More information is required and removed future work To develop into the plugin labels Aug 22, 2023
@github-actions github-actions bot added the Stale label Oct 22, 2023
@Aetherinox
Copy link
Author

Aetherinox commented Oct 22, 2023

Sorry, missed this. I'll poke a look at it tomorrow and see if I can narrow it. This isn't a huge deal, the bigger issue is the shifting text. That bug is so annoying right now.

@github-actions github-actions bot removed the Stale label Oct 23, 2023
@mayurankv
Copy link
Owner

Yep that will definitely be my number 1 priority.

@Aetherinox
Copy link
Author

Thanks. I would be the happiest person in the world. I use Obsidian and your plugin religiously, and I have a lot of codeblocks from all my development work.

Right now as soon as I scroll down in a code block, all the text runs of the screen. Feel like I'm playing pacman and seeing if I can hurry up and copy the code before it runs away. Then I have to leave the doc and come back to get it fixed lol

@Aetherinox
Copy link
Author

Aetherinox commented Nov 4, 2023

Just trying to clean up your workload.

Not sure if it was accidentally fixed in your last update since I first reported this, but nested codeblocks are working fine. I tried creating blocks with titles, highlights, etc.

From what I'm seeing, they all work properly.

pzdbQJm

Used the same exact codeblock I reported last time.

Repository owner deleted a comment from github-actions bot Nov 26, 2023
@mayurankv
Copy link
Owner

Ah that's amazing to hear! Thanks for letting me know. I'll close this for now but do let me know if it starts playing up at any point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed needs info More information is required needs repro Needs reproduction reading mode Relevant to Obsidian reading mode
Projects
None yet
Development

No branches or pull requests

2 participants