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

Support LaTex Math #4838

Merged
merged 16 commits into from
Jan 4, 2022
Merged

Support LaTex Math #4838

merged 16 commits into from
Jan 4, 2022

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Jan 3, 2022

Successor of #2133.

EDIT: Below is done

Need to be rebased after #4837 is merged, and this line will have to be updated from:

markwonPlugins?.forEach { plugin -> plugin.beforeSetText(holder.messageView, message as Spanned) }

to

markwonPlugins?.forEach { plugin -> plugin.beforeSetText(holder.messageView, message?.charSequence as Spanned) }

NickHu and others added 11 commits September 24, 2021 13:50
(matrix-org/matrix-spec-proposals#2191)

Firstly, this implements a commonmark-java plugin which is solely used to parse
LaTeX input in the composer box, so that they can be rendered into
`<span data-mx-maths=...>fallback</span>` and `<div
data-mx-maths=...>fallback</div>` for inline and display maths
respectively in the sent message.

Secondly, received messages of this form are pre-processed by a simple
regex into a form which markwon (which performs the rendering) expects.
Maths support (MSC2191)
@github-actions
Copy link

github-actions bot commented Jan 3, 2022

Unit Test Results

  66 files  ±0    66 suites  ±0   55s ⏱️ +2s
135 tests ±0  135 ✔️ ±0  0 💤 ±0  0 ±0 
418 runs  ±0  418 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 10a63f8. ± Comparison against base commit 39ff9da.

♻️ This comment has been updated with latest results.

@bmarty bmarty force-pushed the feature/bma/math_final branch from 94d758f to 10a63f8 Compare January 4, 2022 15:22
Copy link
Contributor

@ariskotsomitopoulos ariskotsomitopoulos left a comment

Choose a reason for hiding this comment

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

It seems fine.

Minor, I would maybe create global variables regarding:

object Symbols {
        const val DOUBLE_DOLLAR = "$$"
        const val DOLLAR = "$"
      ....
}
object Tags {
        const val DIV = "div"
       ....
}

@bmarty
Copy link
Member Author

bmarty commented Jan 4, 2022

Thanks for the review. I will merge and fix ktlint on develop

@bmarty bmarty merged commit 3ec2a09 into develop Jan 4, 2022
@bmarty bmarty deleted the feature/bma/math_final branch January 4, 2022 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants