tgrosinger / advanced-tables-obsidian

Improved table navigation, formatting, and manipulation in Obsidian.md
GNU General Public License v3.0
2.15k stars 80 forks source link

Formulas containing $ get half-displayed as text #224

Open SanJacobs opened 2 years ago

SanJacobs commented 2 years ago

Describe the bug Parts of formulas past any $-signs get evaluated by Obsidian as if it was normal text, rendering markdown formatting characters as text styling.

This formula:

<!-- TBLFM: $>=(($-3*2)+20) -->

Displays like this, when not in source mode: image

And like this, with ligatures enabled on mobile: image

This is of course expected behavior, given that this is just text in a markdown document.

However, a really easy fix would be if the formulas could be written with the ending arrow containing an exclamation point (--!>), then they seem to display correctly/less-confusingly.

image (I also happen to find this more visually appealing, because it is symmetrical)

When doing that, though, they aren't recognized by the plugin as a formula.

To Reproduce

  1. Write formula containing $ and markdown formatting characters

Expected behavior I expect to see every symbol I have written, and for them to be styled the same, because in this context they are not formatting characters, they are functions.

Desktop:

Mobile:

tgrosinger commented 1 year ago

That is an interesting idea, however it would then no longer be a valid HTML comment, so the formula might be displayed in some rendering engines.

https://developer.mozilla.org/en-US/docs/Web/API/Comment

I'll have to think about this some more.

SanJacobs commented 1 year ago

True. Of course, this probably shouldn't be a forced transition from --> to --!>. However, adding it as a recognized alternative for us users who don't care about the rendering outside of obsidian would be great.

AlexLJordan commented 1 year ago

Hi just wanted to chip in: I'm having the following issue

This line is provoking an error message: <!-- TBLFM: @I$>..@>$>=sum($2..$7) -->

It get's highlighted like this:

Pasted image 20231118010403

When I hover over it, the tooltip says "Misplaced @".

I tried CSS to stop rendering comments in live-preview, but that just removes the part until the first $ symbol:

Pasted image 20231118010829

I'd really appreciate some help here, this bright yellow highlighting is super annoying.