fix replies

This commit is contained in:
hiro98 2020-04-27 13:09:08 +02:00
parent 0dd7574ab6
commit 4799ac8a2b
3 changed files with 11 additions and 10 deletions

View file

@ -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

View file

@ -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.",

View file

@ -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);
}
}