Code Monkey home page Code Monkey logo

Comments (8)

Zachatoo avatar Zachatoo commented on September 24, 2024 1

Templater does support replacing Templater tags inside of codeblocks, so it does make sense why it does it's syntax highlighting. I definitely don't think we should remove support for Templater tags in codeblocks, but I do think there's an argument for disabling just the syntax highlighting in codeblocks.

from templater.

nielsbom avatar nielsbom commented on September 24, 2024 1

I think I came across the same bug. I'm not a 100% sure it's actually a bug though. Using the following note content:

```bash
echo '<%'
```
I am outside the codeblock

Templater shows this as:
CleanShot 2024-02-23 at 15 21 33

Disabling Templater's setting "Syntax Highlighting on Desktop" (I'm working on desktop) produces this:

CleanShot 2024-02-23 at 15 22 27

from templater.

HippyCraig avatar HippyCraig commented on September 24, 2024

'm trying to document some code and the code blocks are behaving a little differently in a callout vs just being in the note independently. I looked on the forums but couldn't find anything to solve the issue but what I did find was people discussing that the java <> brackets may be causing a rendering issue possible that it thinks there are HTML instead of just code.

Below is a screen shot of what I am seeing, on the left is the source of the MD file the Right is rendered in Read View. Unfortunately the render is not always consistent, sometime its completely off without any change but there is no discernable pattern to it.

image

I have tried to use other characters in place of the <> like escaping it or even using < but the render just looks the same it does in edit mode, it doesn't resolve to anything

image

I tried a clean vault with no plugins and it worked like I would expect it to. Im ok with putting escape character within my code block but when I add them and go to the reading pane it shows the escape character as well as the charter is supposed to escape in the first place.

Again if there was a way to escape the character in the editing page but rendered correctly I would be fine and I think that would solve the problem for most.

from templater.

scmanjarrez avatar scmanjarrez commented on September 24, 2024

I also think that's a bug, the mere presence of <% just destroys the code block rendering. I had to disable every plugin until I found that templater was causing this issue with my code blocks.

from templater.

HippyCraig avatar HippyCraig commented on September 24, 2024

Interesting is there a way to escape that? or even use some sort of char code ASCII 60 and 37 to display instead of the actual <% or even a unicode character number

ASCII

&gt;&#37;  = <%
&#37;&lt;    = %>

UTF-8

&#x003C;&#x0025;  = <%
&#x0025;&#x003E;   = %>

from templater.

HippyCraig avatar HippyCraig commented on September 24, 2024

Im sorry just having a little trouble following this last part of the thread, is this issue being tabled? Is there some sort of work around to have it display? Or is it marked as some future feature request?

from templater.

Zachatoo avatar Zachatoo commented on September 24, 2024

This is a very difficult problem to solve, the syntax highlighting code is very complex and was written by someone who no longer contributes to the Templater project. I don't know when this will be fixed.

For now, I suggest disabling syntax highlighting for Templater if you are affected by this issue. Or only enabling it when you're working on A template and disabling it when you're done.

from templater.

HippyCraig avatar HippyCraig commented on September 24, 2024

Ok thanks, I was just curious is all.

from templater.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.