zhaoshenzhai/obsidian-mathlinks

MathLink in dataview inline field disappears

joelatschool opened this issue · 6 comments

DataView allows adding a data field to a note inline using the following syntaxes:

The game was developed by (developer::[[Mobius Digital]]) and published by [publisher::[[Annapurna Interactive]]].

Either of these syntaxes results in new DOM elements being added in reading view in order to add special formatting to these inline fields. This is how it appears in the default theme:
image
And this is how it appears in minimal theme:
image

However, after adding a MathLink to the first link to display an $\aleph$ and to the second to display an $\alpha$, they now appear as follows:
image
image

Those are the only tests that I ran (never used dataview, so I'm not familiar with any of its other functionality). If there are other cases where links are used in dataview, please let me know and ill include them too. Cheers :)

Scrot_2023_06_30_152721

Thanks for the fix! This works for almost everything, although I notice that in the edge case the link is part of a callout and is being rendered in live preview, it still disappears. Should I open a new issue?

Could you describe the edge case a bit more? Also, I've completely reworked how mathlinks are handled in live-preview in 0.3.2, so please update it to this version and see if the issue persists.

Sure, so if some definition.md has a MathLink and you write something like:

>[!theorem]
>(datafield::[[some definition]]) has the universal property that blah blah blah 

Then this bug still occurs; in live preview nothing displays for the some definition.md link.

I see... I'll look into it and see what I can do

@joelatschool

Though theres still some details to be ironed out, I've made some changes and it seems to be working for the most part.

  • Top left: source
  • Bottom left: reading
  • Top right: live-preview hovering outside the callout
  • Bottom right: live-preview hovering inside the callout.

Sometimes (can't reliably reproduce yet) the note is still being rendered in live-preview despite switching to source mode, but this seems to only happen with callouts. I'll look into this later when I have some time, but refreshing the note should fix it temporarily.

Scrot_2023_07_03_133956