Angular brackets ">" will mess live preview of codeblocks in quotes and callouts

Just be aware that if some user will copy the text into the IDE, he would get errors for the invisible space character and would need to delete them manually.

So I still see this as very annoying bug that should be fixed in the Obsidian. And it has been reported more than a year ago :frowning:

6 Likes

Do we know where this bug is coming from? I mean, if we try these examples in code mirror 6 do they work? Or is it coming from the live preview code? :frowning:

I’m having this problem too, can’t believe this is already a bug report for 2022, when is obsidian going to fix it?

3 Likes

Created an account just to say I’m having the same very annoying issue.

5 Likes

So we got two decent workarounds:

  1. closing the first HTML tag: <p/>This will render okay</p>
  2. adding a number before the first HTML tag: <0p>This will work too</p>

It’d be nice if Obsidian would fix that issue though.

Currently, I’m learning Rust and I usually put it in callout to collapse it (reduce distraction). Whenever I declare sth like Box<T>, it would break the block. So I have to workaround with Box< T >, which annoys me do much. I don’t know this is a bug by Markdown flavor or because of how live preview is implemented. But if it’s because of live preview, please, I’m begging Obsidian team to fix bug :sob:

Also made an account just to talk about this issue. It’s currently the biggest issue I have with Obsidian and it’s made me consider other documentation/note options, just because the current syntax means it takes SIGNIFICANTLY longer for me to write notes because I’m busy inserting angle brackets for blockquote markup manually in the XML snippets I’m trying to insert into my callouts–and god forbid I ever try to nest callouts and then insert a code block into that. This, of course, ignores the live preview issues that also pop up with this feature.

However, I did find an acceptable workaround: just use the Admonitions plugin instead. It’s what everyone apparently used before Obsidian’s native callouts, and its syntax is much, much friendlier for this particular use-case than the blockquote-based markout Obsidian uses–editing and copy/pasting code blocks largely just works, whereas doing any of that stuff in the native callouts feature is prone to breakage and formatting issues. And Admonitions works perfectly fine in live preview mode too!

The only thing that sucks about this approach is that the Admonitions plugin is in maintenance mode, probably because it was “superseded” by Obsidian’s native callouts feature. But it’s so much more difficult to work with than Admonitions that I’ll just live with using a quasi-deprecated plugin or think about migrating out of the Obsidian ecosystem entirely.

1 Like

Here’s some sample markdown that easily reproduces a variation of this bug in the sandbox vault on Obsidian 1.7.0

screenshot:

2 Likes

```python
<?xml
test
```

try to put above one as a callout
it will break

same as

```python
<script>
test
```

There is still this problem. Dear developers, will you do anything with it?

2 Likes

Any news about this? Whether it’s a “no we won’t fix it” or “it’s in the roadmap but low prio”?

2 Likes

I made an account just to talk about this issue.
I understand that it might be a difficult bug to solve, but please don’t just write this issue under “not supported” : Obsidian should be able to do this.

# Lorem ipsum
Lorem *ipsum* **dolor** sit *amet*, **consectetur** adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

> [!IMPORTANT]
> Lorem *ipsum* :
> ```xml
> <tag name="This xml line is read by Obsidian while it shouldn't.">
> ```
> This part of the document is now broken because the XML line is interpreted as an HTML tag and is never closed.
> Lorem *ipsum*

# Lorem ipsum
Lorem *ipsum* **dolor** sit *amet*, **consectetur** adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

I just wrote a simple plugin to fix it, with only 32 lines of code.

5 Likes

I had some issues installing your plugin from mobile, but I just want to say you’re freaking amazing @the_tree !!!
If you have a way for me to send you a coffee please let me know :slight_smile:

Btw you should totally add this as an official obsidian plugin

Please, keep the conversation about the plugin in the plugin repository.