Live preview mode + <% in code block

What I’m trying to do

I have a code block

git log \
  --graph \
  --abbrev-commit \
  --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'

…and then some regular text below.

Because of the <% in the last line the Live Preview mode renders the regular below this code blocks as if it’s part of the code block.

If I switch to Reading View the Markdown rendering is correct.

Things I have tried

  • surround the code block with <code> tags instead of triple backticks

Please follow and include the entire template when submitting bug reports. Thanks.

Your exact code block looks alright over here in both Live Preview and Reading view (Obsidian v1.5.3).


I can’t reproduce. post a screen recording of this happening in the sandbox vault.

I have the same problem.
Perhaps it comes from this issue but I have no knowledge to fix it…

スクリーンショット 2024-02-18 15.01.29

スクリーンショット 2024-02-18 15.01.57

1 Like

Yeah, it seems like a Templater issue.

CleanShot 2024-02-18 at 19.46.17

1 Like

Yes that seems to be it, thank you!

I think I’ve found the relevant issue on the Templater repo.

Disabling Templater’s setting “Syntax Highlighting on Desktop” renders the note as I want it to, at the cost of not having syntax highlighting for Templater templates of course.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.