glushchenko / fsnotes

Notes manager for macOS/iOS

Home Page:https://fsnot.es

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MathJax formatting issue

tryonkus opened this issue · comments

Description

I was just playing with the MathJax example note and changed the last bit to this (double dollar signs around the first equation):

## MathJax example

Documentation: https://www.mathjax.org

> Please choose: View > Preview MathJax

When $$((a \ne 0))$$, there are two solutions to $$ax^2 + bx + c = 0$$ and they are
$$x = \{-b \pm \sqrt{b^2-4ac} \over 2a\}.$$

When it rendered, the 2a at the bottom was partially cut off (see screen grab below):

MathJax formatting bug

When I entered just the equation text into a new note, it rendered correctly.

To Reproduce

Edit text as described above

Expected behavior

Full equation should be rendered

FSNotes version

6

macOS/iOS version

14.4.1

Additional context

No response

The entire note renders correctly here:

6. Mermaid and MathJax

Mermaid example

Documentation: https://mermaidjs.github.io

sequenceDiagram
    participant Alice
    participant Bob
    Alice->>John: Hello John, how are you?
    loop Healthcheck
        John->>John: Fight against hypochondria
    end
    Note right of John: Rational thoughts <br/>prevail!
    John-->>Alice: Great!
    John->>Bob: How about you?
    Bob-->>John: Jolly good!
Loading

MathJax example

Documentation: https://www.mathjax.org

Please choose: View > Preview MathJax

When $$((a \ne 0))$$, there are two solutions to $$ax^2 + bx + c = 0$$ and they are
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$

Curiouser and curiouser . . .

From the MathJax documentation:

The default math delimiters are $$...$$ and \[...\] for displayed mathematics, and \(...\) for 
in-line mathematics. Note in particular that the $...$ in-line delimiters are not used by default. 

Yet, FSNotes uses $ as an in-line delimiter and doesn't recognize the standards. Is this a GitHub flavored MathJax? I'm a bit of a newbie. The GitHub renderer seems to recognize $ and \$ both as a dollar sign character.

https://docs.mathjax.org/en/latest/input/tex/delimiters.html#tex-delimiters

Also, this page seems to say that MathJax does support $...$ in some cases:
https://docs.mathjax.org/en/latest/input/tex/differences.html

If I type

The costs are $40 dollars and $30 dollars.

it renders as

Screenshot 2024-04-20 at 6 21 06 PM

Not any criticism here—I just like playing with new software, and I'm good at breaking stuff. My nephew is a software tester, and I may have missed my calling (I'm in IT support and admin).

If I type

The costs are $40 dollars and $30 dollars.

it renders as

Screenshot 2024-04-20 at 6 21 06 PM

Yes.

Believe me, I know a lot more FSNotes problems, and not just in the parser. Pull requests would be much more useful, but no.

If I were a programmer, I’d be happy to dive in and debug. Sadly, I’m better at finding bugs than fixing them. I think it’s a great app, and I’m pushing some of the more obscure features.

If I were a programmer, I’d be happy to dive in and debug. Sadly, I’m better at finding bugs than fixing them. I think it’s a great app, and I’m pushing some of the more obscure features.

I am aircraft engines engineer, but occasionally i write the code. If you have ideas on how to improve the code, welcome to pull requests.

Thanks for the feedback, but i can't devote any more time to this task, sorry.