1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-02 12:47:41 +02:00

All: Resolves #1105: Added support for macro persistence for Katex

This commit is contained in:
Laurent Cozic 2019-02-28 22:32:10 +00:00
parent 1adbbd14c6
commit 4363005e92

View File

@ -8,6 +8,11 @@ class MdToHtml_Katex {
constructor() {
this.cache_ = {};
this.assetsLoaded_ = false;
// Keep macros that persist across Katex blocks to allow defining a macro
// in one block and re-using it later in other blocks.
// https://github.com/laurent22/joplin/issues/1105
this.macros_ = {};
}
name() {
@ -24,6 +29,7 @@ class MdToHtml_Katex {
} else {
renderered = katex.renderToString(content, {
displayMode: tagType === 'block',
macros: this.macros_,
});
this.cache_[cacheKey] = renderered;
}