Skip to content

Upgrade tui.editor from version 2.5 to version 3.x (#137)#141

Merged
ryanmcalister merged 3 commits into
ryanmcalister:masterfrom
kiyoka:fix_issue_137.2
Oct 20, 2022
Merged

Upgrade tui.editor from version 2.5 to version 3.x (#137)#141
ryanmcalister merged 3 commits into
ryanmcalister:masterfrom
kiyoka:fix_issue_137.2

Conversation

@kiyoka
Copy link
Copy Markdown
Contributor

@kiyoka kiyoka commented Sep 29, 2022

Migrated to tui.editor 3.2.1 or higher.
This fixed some bugs caused by older version of tui.editor.

Target Unotes version:
1.4.4

Description

Issue fixed by upgrading Tui.editor

This is a critical issue that prevents usability, so I fixed it.

Migration

I Follow the migration guide below.
https://github.com/nhn/tui.editor/blob/master/docs/v3.0-migration-guide.md

Tested

  • Tested only on Windows 11 Home.
  • Checked if the theme follows dark mode.
  • Checked if the toolbar order has not been changed.
  • Checked if the image is saved as a local file when pasting an image.
  • Checked if Template Notes works.
  • Checked if the chart plugin works.
  • Checked if the PlantUML plugin works.
  • Checked if the Katex plugin works.
  • Checked if code syntax highlighting works.
  • Checked if all keyboard shortcuts of Unotes work.( Ctrl + Alt + ... )

Notice

tui.editor 3.2.0 has a fatal bug.
nhn/tui.editor#2729
This issue has been fixed in tui.editor 3.2.1, so we need to use 3.2.1 or higher.

Feature Request: Upgrade tui.editor from version 2.5 to version 3.x
@ryanmcalister ryanmcalister self-assigned this Oct 4, 2022
Copy link
Copy Markdown
Owner

@ryanmcalister ryanmcalister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for the update!

Some issues I've come across are with the Katex support. The codeblock with the katex language doesn't seem to work anymore in the preview window:
image

I like the inline katex support. It seems to have an issue too that I'm not sure how to fix...
If I start with this:

$$katex
\begin{aligned}
\int_0^12\frac{x^3(1-x)^3}{10+x^2}\,dx &=\frac{22}{17}-\pi\\ \\
\int_{-\infty}^\infty e^{-x^2}\,dx &=\sqrt{\pi}
\end{aligned}
$$

It renders ok at first, but when the page reloads, some escape (\_) characters are added:

$$katex
\begin{aligned}
\int\_0^12\frac{x^3(1-x)^3}{10+x^2},dx &=\frac{22}{17}-\pi\ \\
\int\_{-\infty}^\infty e^{-x^2},dx &=\sqrt{\pi}
\end{aligned}
$$

@kiyoka
Copy link
Copy Markdown
Contributor Author

kiyoka commented Oct 6, 2022

@ryanmcalister
I have committed.
Here, try this.

  1. I have dropped codeblock support.
    The reason is that it conflicts with codeSyntaxHighlight plugin in tui.editor 3.x.
    If the formula drawn in codeblock with Katex's Plugin, codeSyntaxHighlight overwrites it and breaks it.

  2. character escape feature
    tui.editor 3.x seems to have a feature to escape (_).
    If you save a file before enclosing it in $$, it seems that (_) is converted to (\_).
    Latex strings enclosed in $$ previously do not seem to be converted even after reloading.

inline_katex

@ryanmcalister
Copy link
Copy Markdown
Owner

2. Latex strings enclosed in $$ previously do not seem to be converted even after reloading.

hmm, I'm still seeing the escaping of _ when I reload the note or switch between markdown.

@ryanmcalister
Copy link
Copy Markdown
Owner

Thanks for the PR. I really appreciate the work done here!

@ryanmcalister ryanmcalister merged commit 507f404 into ryanmcalister:master Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment