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

✨(forum) enables latex mathematical syntax #277

Merged
merged 3 commits into from
Dec 29, 2022
Merged

✨(forum) enables latex mathematical syntax #277

merged 3 commits into from
Dec 29, 2022

Conversation

carofun
Copy link
Contributor

@carofun carofun commented Dec 16, 2022

Purpose

Using katex, we enable latex mathematical syntax in draft.js to write equations in forums.
In draft.js press $ for starting Inline TeX and to write the $ character, type $

Proposal

Enregistrement.de.l.ecran.2022-12-16.a.16.08.37.mov
  • disable code-editor plugin
  • enabling draft-js-latex plugin

@carofun carofun self-assigned this Dec 16, 2022
@carofun carofun force-pushed the feat/latex_ branch 5 times, most recently from 1a58937 to 18b28a3 Compare December 16, 2022 15:52
@sampaccoud sampaccoud changed the title ✨(forum) enables latext mathematical syntax ✨(forum) enables latex mathematical syntax Dec 16, 2022
@carofun carofun marked this pull request as ready for review December 19, 2022 08:48
Copy link
Member

@jbpenrath jbpenrath left a comment

Choose a reason for hiding this comment

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

What do you think to add a button within the toolbar to add formula ?

src/frontend/package.json Show resolved Hide resolved
src/frontend/js/utils/latex.ts Outdated Show resolved Hide resolved
@carofun
Copy link
Contributor Author

carofun commented Dec 21, 2022

yes i think it's a good idea, maybe I can add it in another PR

Copy link
Member

@jbpenrath jbpenrath left a comment

Choose a reason for hiding this comment

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

Some nitpicks then LGTM ✅ !

src/ashley/editor/decorators.py Outdated Show resolved Hide resolved
src/frontend/jest.config.js Outdated Show resolved Hide resolved
@jbpenrath
Copy link
Member

yes i think it's a good idea, maybe I can add it in another PR

I opened an issue to not forget this point 😉
#278

The repository containing the list of valid emojis has just
got transformed into a monorepo causing the old url to be
obsolete.
Historically code-editor plugin was added to ease the
edition of programming language in a code-block in draft-js :
 - the use of the`tab` button was keeping the user in
the draft-js code-block
- an extra bloc was added once we were in the code-block
so the user could exit it without adding one himself.
Unfortunately, using other plugins that need to use the
keyboard event, it appears to be in conflict.
As a matter of fact, adding an extra block is not so
important, as user can still exit the block using the
back arrow key and the use of the tab is not that wise
as it's not a good manner for accessibility, so we finally
decided to just delete the use of this fork and keep the
normal behavior of draft-js.
Using katex, we enable latex mathematical syntax in
draft.js to write equations in forums.
In draft.js press $ for starting Inline TeX, to
write the $ character, type \$, and Press CMD + M for
starting Tex Block
@carofun carofun merged commit f740c76 into master Dec 29, 2022
@carofun carofun deleted the feat/latex_ branch December 29, 2022 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants