You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-08-13 22:12:50 +02:00
All: Resolves #1105: Added support for macro persistence for Katex
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user