From 4799ac8a2b73927f8cdaf0c4adeafa71b377c64d Mon Sep 17 00:00:00 2001 From: hiro98 Date: Mon, 27 Apr 2020 13:09:08 +0200 Subject: [PATCH] fix replies --- README.md | 4 ++-- manifest.json | 2 +- riot-katex.js | 15 ++++++++------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index df18ee2..d345665 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/manifest.json b/manifest.json index a3b8677..53afa53 100644 --- a/manifest.json +++ b/manifest.json @@ -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.", diff --git a/riot-katex.js b/riot-katex.js index 60f8d53..9611495 100644 --- a/riot-katex.js +++ b/riot-katex.js @@ -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); } }