Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PRO]: Multiple lines in Mathematics doesn't work #4986

Open
1 of 2 tasks
tuphan-dn opened this issue Mar 18, 2024 · 1 comment
Open
1 of 2 tasks

[PRO]: Multiple lines in Mathematics doesn't work #4986

tuphan-dn opened this issue Mar 18, 2024 · 1 comment
Labels
Category: Pro The issue or pull request is related to the pro packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug

Comments

@tuphan-dn
Copy link

tuphan-dn commented Mar 18, 2024

Which packages did you experience the bug in?

extenstion-mathematics

What Tiptap version are you using?

2.2.4

What’s the bug you are facing?

The @tiptap-pro/extension-mathematics displays $\sqrt[n]{x}$ ok, however, it cannot detect a multiple-line one.

For example (note that all the lines were in a single block and it satisfied the default regex /\$([^\$]*)\$/gi):
$
\sqrt[n]{x}
$

P/s: for very complex equations, break-lines are very helpful in making organizational equations.

What browser are you using?

Chrome

Code example

<p>$<br>\sqrt[n]{x}<br>$</p>

What did you expect to happen?

@tiptap-pro/extension-mathematics can work with @tiptap/extension-hard-break so that it's able to display/render the equation as normally as the inline equation.

Anything to add? (optional)

Did you update your dependencies?

  • Yes, I’ve updated my dependencies to use the latest version of all packages.

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖
@tuphan-dn tuphan-dn added Category: Pro The issue or pull request is related to the pro packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug labels Mar 18, 2024
@github-project-automation github-project-automation bot moved this to Triage open in Tiptap Mar 18, 2024
@jbergfi
Copy link

jbergfi commented Nov 19, 2024

I have same issue although I'm not using extension-hard-break. I want to use multi-line formulas but newlines always get converted to separate paragraphs which breaks Latex editor and Katex handling.

Example:

$\begin{bmatrix}
2 & 0 & 0\\
1 & 2 & 1\\
0 & 0 & 1
\end{bmatrix}$

This gets rendered as:

<p>$\begin{bmatrix}</p>
<p>2 &amp; 0 &amp; 0\\</p>
<p>1 &amp; 2 &amp; 1\\</p>
<p>0 &amp; 0 &amp; 1</p>
<p>\end{bmatrix}$</p>

which is then not handled as Latex. I'm using StarterKit with the Paragraph extension which I want when not in a Latex node.

The problem happens both when typing in and when copy-pasting. I would expect newlines within Latex expression to be kept as is and being able to show them in mathematics editor with white-space: pre; style.

As already said using newlines in the fomulas would be quite important for complex expressions.

@github-project-automation github-project-automation bot moved this to Needs Triage in Tiptap: Issues Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Pro The issue or pull request is related to the pro packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug
Projects
Status: Needs Triage
Status: Triage open
Development

No branches or pull requests

2 participants