How do I change the highlight symbol?

I am trying to take notes on HTML and I want the notes to stop interacting with the markdown features that I simply want to disable. This includes converting the notated hypertext notes, such as what ordered list tags look like and so forth, into empty and useless html elements as if they were displayed on an empty webpage. I have been able to disable this conversion by setting my default viewing to source mode and including some css I got from the forums that disables the markdown conversion, but when I try to drag and add these notes from the vault to a canvas they get converted again and I am not able to organize the notes in a visible and readable format. I also have notes on javascript and the comparative operators like === and !== are getting converted to highlighted text when I don’t want them to.

ALL I WANT is to change the notation of highlight markdown symbol from == to literally anything else

I realized as of writing this that including ``` will have the code block notated like a code block is supposed to be, but now I can highlight anything.

I would like to be able to change the highlight markdown symbol to something else so I can highlight code without it interacting with the markdown features.

My solution for now is to copy and paste all my html notes to a canvas where the bits I want highlighted can get highlighted within the box and I can separate the code examples so they don’t overlap. But I would like to know how or where in my code I can just change the symbol that initiates a highlight and I would be able to have my cake and eat it too.

Too have a simple notes page (not a canvas) with bits of highlighted code.

You can use CSS to change what ==happy new year== looks like in a note, but I think fenced code blocks are the way to go here for what you are describing.

yes but I cannot highlight in the code block and the code block interacts with the markdown in the same instance.

All this means is my notes look bloated and weird when I could have conveyed the correlation 10x better by just being able to highlight.

For example

<a href="https://www.wikipedia.org/">This Is A Link To Wikipedia</a> 
is different than
<a href="https://en.wikipedia.org/wiki/Brown_bear" target="_blank">The Brown Bear</a>

I want to highlight href in the first line and explain what it means but adding == doesnt highlight because ive disable it by adding
/* remove formatting and set font to single size monospace /
.markdown-source-view:not(.is-live-preview) * {
background: unset !important;
color: unset !important;
font-size: 1rem !important;
font-weight: unset !important;
font-family: monospace !important;
}
/
in case themes uses ::after div formatting for borders and so on */
.markdown-source-view:not(.is-live-preview) *::after {
border: unset !important;
}
I added this^ to disable the colored text that comes with html but it also disables the highlighting feature as well as all markdown utility.

Disabling this snippet allows me to highlight again but in source mode highlighting href in this instance looks like

<a ==href==="https://www.wikipedia.org/">This Is A Link To Wikipedia</a>

Where the equals signs cause it to be highlighted but the equals signs dont go away after that.

As I said what I am asking for is to have my cake and eat it too. The most I think I can do is go in and manually change what symbol causes highlighting… its just I dont know how to do that lol. What I really need help with is just how to change that one thing.

Do different premade themes have different markdown shortcuts for different use cases?
If so this could be my solution.

I’m on mobile at the moment, so won’t be checking, but Markdown won’t render within html tags. Is that that issue here?

https://help.obsidian.md/Editing+and+formatting/HTML+content

no sorry maybe I went the long way around on the explanation of what exactly I want.

I want to highlight parts of code, but the highlight function is a part of the built in markup features. Those markup features are disabled by a snippet, because as well as highlight, they convert the html notes into the elements as if they were displayed on a webpage. I dont want this. I want to have the best of both worlds. I want to highlight code AND have the notes NOT converted to html. I asked if I could change what symbol causes highlighting because I thought that could be a partial solution. What I really want is to disable html conversion and preserve the ability to highlight.

If you use the Code styler plugin it can help in various forms for highlighting within code blocks. Not sure if it can actually only highlight parts of a line, but it can for sure highlight any line in your code block helping you to accentuate the lines you’re explaining.

It can also do various other colors, styling and so on related to your code block, so I would take a thorough look at this plugin and see if you can’t be helped with using this.

TYSM i will check this out

I think my initial explanation of the problem was a bit confusing so I’m going to try again.

I want to take notes on html

But the html tags are getting converted to look like they display on a webpage.

<p>content within these tags gets converted<p>

to sometimes display nothing.

When taking notes on javascript I will surround my code examples with the “```” but now I am no longer able to highlight individual words without the words I want highlighted looking like ==this==

Problem #
I surround my html with ``` to avoid markup but now no longer have highlighting

Problem #2
Javascript doesnt interact with html automatic conversion but will have unnecessary highlighting because of the frequent use of ==

Conclusion
Taking notes on code in obsidian inherently collides with the many features that obsidian provides since these features take advantage of the html coding language. Which inevitably collides syntactically with any coding language you could attempt to take detailed notes on. ESPECIALLY if those notes are on the very language that provides these features.

The solution to this problem is way more complicated than I anticipated for as I said in my first post, I want to bake my cake and eat it to.

For example

I have moved on to taking notes on CSS but this still applies

I want to highlight the word “style” in the following line of code

<p style='color:blue;'>Hello World!<p>

but adding the equals signs that trigger a highlight looks like this

<p ==style==='color:blue;'>Hello World!<p>

which is not what I want

But taking it out of the code block coverts it to just Hello World! in blue text

Mind you Im doing this all in a Canvas which will convert my boxes to reading view no matter what

I have tried plugins for highlighting and they have the same problem of rendering the tag for highlighting in a code block

I have tried the code styler plugin recommended by @holroy but as stated that will only highlight entire lines and not individual words

I have tried canvas plugins but none of them state they are able to disable reading mode for canvas nodes.

No matter what I keep running into the problem of either

One
The code block surrounded by ``` containing an unwanted highlight tag

Or two
The code block interacting with the built in html conversion in an unwanted way

I have either one or both of these problems at the same time depending on the particular line of code I want to take notes on.

What I want is for “style” in the line of code above to be highlight without any of the text being colored and without a highlight tag (==) being visible.

I also want the highlight tag to not be visible on my notes on html, which takes advantage of the html automatic conversion, without having any other html tags automatically being converted to a webpage.

This in my mind can only be achieved with a completely custom made webpage.

Or by disabling the automatic markup entirely (WHICH I AM NOT ABLE TO DO FOR SOME REASON AGH) while still being able to highlight using a different means or functionality. While being able to do so in a canvas.

I think this post now that I have been able to mule over this for a while should be in feature requests as I am asking for something that I am pretty sure is not accommodated for yet.

The features that I would request are the ability to disable ALL html conversion

And an entirely new way to highlight that doesn’t need CSS or html

Both of these are required if I am able to preserve the syntax of the languages I want to take notes on without having to make significant compromises to the way I highlight (only entire lines) or my ability to draw visual semantic relationships on a canvas as it pertains to particular words or phrases within specific section of single lines.

I have a feeling not everyone takes notes on code to this level of detail XD. Am I the only one?

I feel there is a value to outlining every single aspect of particular blocks or lines of code as this demands the deepest and most syntactically sound understanding which only improves your ability to read code and write code.

I don’t think it is possible to do what you want within Obsidian. At least without writing some plugin that would change how markdown is parsed, which is not easy.

If you want to write html without parsing and be able to highlight, then for the small bits of code you can just escape angular brackets and equal signs like this:

\<div ==style==\="color: red"\>\</div\>

But this solution will be too tiresome for the big amount of code, obviously.

OMFG THIS HELPS SO MUCH I had no idea the angular bracket could do that. This might be a patchwork solution but still a solution as all I needed is for it to look good.
GOD BLESS YOUR SOUL!!!

I’ve been busy, so haven’t had time to follow up on this, but I don’t know of any other solution related to styling within a code block than the one I listed.

However, if you go down the road of not encapsulating stuff within a code block, you’ve got one very basic option similar to what @reaty suggests, and that is to push your text to a urlencoder, and simply replace any troublesome character with something not interpreted by obsidian.

I do sometimes use the backslash escape, but I also do use &lt; instead of < and &gt; instead of >. This definitively escapes them from interpretion, and if you wanted to do this on a regular basis I would strongly suggest to build a Templater template to do the necessary replacement for you. It could take either the selected text, or possibly the clipboard content and convert/replace it after doing the wanted replacements within that text.

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