robinv8 opened a new pull request, #335: URL: https://github.com/apache/answer-plugins/pull/335
Entering `$ $$` can cause the formula renderer to repeatedly observe its own KaTeX DOM updates and leave the editor unresponsive. Disconnect the observer while rendering and restore it in `finally`, while continuing to observe subsequent edits and text-node changes. Also handle empty element refs safely. Refs https://github.com/apache/answer-plugins/issues/313. This addresses the editor freeze; a companion Answer core PR handles formulas missing on the first render of answers. Both fixes are needed to resolve the reported issue. Validation: - 9 committed regression tests: `cd editor-formula && node --test tests/hooks.test.cjs`. - Plugin TypeScript, changed-file ESLint, and Vite production build passed. - Real Chromium against an isolated Answer instance with SQLite and the actual formula plugin: malformed input followed by more edits, formula preview, posting questions/answers, full-page reload, and editing/saving/reloading all passed. - Tests add jsdom as a development dependency; package scripts are unchanged. - Firefox and Safari were not tested. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
