advanced-tables-obsidian icon indicating copy to clipboard operation
advanced-tables-obsidian copied to clipboard

Formulas containing $ get half-displayed as text

Open SanJacobs opened this issue 2 years ago • 3 comments

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:

  • OS: Windows 10
  • Obsidian Version: 1.0.3
  • Advanced Tables Version: 0.18.0

Mobile:

  • OS: Android
  • Obsidian Version: 1.4.1
  • Advanced Tables Version: 0.18.0

SanJacobs avatar Nov 28 '22 13:11 SanJacobs

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.

tgrosinger avatar May 25 '23 15:05 tgrosinger

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.

SanJacobs avatar Jun 04 '23 21:06 SanJacobs

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.

AlexLJordan avatar Nov 18 '23 00:11 AlexLJordan