Skip to content

[BUG] Proposed Fix To Errors When Using Codeblock Math Mode #316

@WhoAmI-WhereAmI

Description

@WhoAmI-WhereAmI

Description

currently, when using codeblocks, latex suite constantly warns:
plugin:obsidian-latex-suite:13223 unable to locate start of the codeblock even though inside one

also, when putting math as codeblock language, it now errs:
TypeError: Cannot read properties of null (reading 'from') at getCodeblockBounds (plugin:obsidian-latex-suite:13211:52) at _Context.getInnerBounds (plugin:obsidian-latex-suite:13133:16) at _Context.isWithinEnvironment (plugin:obsidian-latex-suite:13082:25) at _Context.inTextEnvironment (plugin:obsidian-latex-suite:13114:17) at _Context.fromState (plugin:obsidian-latex-suite:13071:30) at _Context.fromView (plugin:obsidian-latex-suite:13077:21) at handleKeydown (plugin:obsidian-latex-suite:15237:23) at Object.onKeydown (plugin:obsidian-latex-suite:15231:19) at app.js:1:375614 at e.runHandlers (app.js:1:373670)

To Reproduce

also happens in sandbox vault with only latex suite downloaded.

Expected Behavior

should be able to locate codeblock properly

Additional Info

in main.js file of latex suite plugin, function escalateToToken is the cause of error.
the fix is to search for HyperMD-codeblock_HyperMD-codeblock-bg instead of HyperMD-codeblock_HyperMD-codeblock-begin
at line 13212 and 13225.
supposedly obsidian itself has changed the name at some point...?
however, doing this somehow hinders the friendly popup equation and it won't work now.
if sbd with any idea what's going on can leave a comment that'd be awesome

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions