inducer
(Andreas Klöckner)
8 أغسطس 2023، 2:19ص
1
Are there special steps require to enable math in chat? On my instance (Discourse 3.1, with
committed 11:31PM - 18 Jul 23 UTC
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.… 4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)
---
updated-dependencies:
- dependency-name: word-wrap
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
which includes the chat+math support mentioned in this post )
math works fine in normal topics, but in chat, it does not appear to work. Am I missing a step? Anything I could do to troubleshoot?
Thanks!
إعجاب واحد (1)
inducer
(Andreas Klöckner)
9 أغسطس 2023، 1:44ص
2
I’ve done a little bit of digging. It seems that, at this point in the code:
function mathjax(elem, opts) {
if (!elem) {
return;
}
let mathElems;
if (opts.enable_asciimath) {
mathElems = elem.querySelectorAll(".math, .asciimath");
} else {
mathElems = elem.querySelectorAll(".math");
}
if (mathElems.length > 0) {
const isPreview = elem.classList.contains("d-editor-preview");
ensureMathJax(opts).then(() => {
mathElems.forEach((mathElem) => decorate(mathElem, isPreview));
});
}
}
it is assumed that the elements to be put through MathJax have a math
CSS class. But a test chat message (I’m using Test $\alpha$ math?
) does not seem to have any such elements when the DOM elements are run through the registered decorateChatMessage
callback.
إعجاب واحد (1)
j.jaffeux
(Joffrey Jaffeux)
14 أغسطس 2023، 9:24م
3
Good catch thanks. This should be fixed by:
discourse:main
← discourse:correctly-enables-features
opened 09:18PM - 14 Aug 23 UTC
Prior to this fix discourse-math would not correctly be cooked in chat messages.
5 إعجابات
j.jaffeux
(Joffrey Jaffeux)
تم إغلاقه في
16 أغسطس 2023، 9:24م
4
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.