mirror of
https://github.com/vale981/riot-katex
synced 2025-03-04 08:41:39 -05:00
fix replies
This commit is contained in:
parent
0dd7574ab6
commit
4799ac8a2b
3 changed files with 11 additions and 10 deletions
|
@ -4,8 +4,8 @@ This extension injects KaTeX into the `Riot` chat client for
|
|||
`matrix`.
|
||||
|
||||
## Writing LaTeX
|
||||
- `$$x^2$$` renders math block style
|
||||
- `\(x^2\)` renders math inline
|
||||
- `$$$x^2$$$` renders math block style
|
||||
- `$$x^2$$` renders math inline
|
||||
|
||||
|
||||
## Download and Installation
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"manifest_version": 2,
|
||||
"name": "Riot KaTeX",
|
||||
"version": "1.0.8",
|
||||
"version": "1.0.9",
|
||||
|
||||
"description": "Renders formulas on riot chat instances chats using KaTeX.",
|
||||
|
||||
|
|
|
@ -15,11 +15,12 @@
|
|||
/**
|
||||
* Set up math delimiters.
|
||||
*/
|
||||
const math_config = [
|
||||
{left: "$$", right: "$$", display: true},
|
||||
{left: "\\(", right: "\\)", display: false},
|
||||
{left: "\\[", right: "\\]", display: true}
|
||||
]
|
||||
const math_config = {
|
||||
delimiters :[
|
||||
{left: "$$$", right: "$$$", display: true},
|
||||
{left: "$$", right: "$$", display: false}
|
||||
],
|
||||
}
|
||||
|
||||
/**
|
||||
* Render math in a node if it hasn't already be done
|
||||
|
@ -42,8 +43,8 @@
|
|||
continue;
|
||||
|
||||
let og_content = (' ' + content.textContent).slice(1);
|
||||
content.setAttribute('originalContent', og_content);
|
||||
renderMathInElement(content);
|
||||
//content.setAttribute('originalContent', og_content);
|
||||
renderMathInElement(content, math_config);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue