Mara-Li / obsidian-regex-mark

MIT License
16 stars 0 forks source link

[Bug]: CSS snippets don't render correctly when applied to Latex expressions, but only while line is not selected #15

Open st4rt-up opened 1 week ago

st4rt-up commented 1 week ago

Issue validation

Describe the bug

Latex expressions render as regular text when not selected, but render normally while the line is selected

https://github.com/user-attachments/assets/b3baf98f-1637-4fcd-b327-45ee1c999796

How to reproduce ?

  1. Create basic CSS snippet with minimal changes to text to show it's being applied (ex colour)
  2. Create regex statement with settings in above video (regex: "(.+?)" , hide tags)
  3. Write text that would apply the CSS snippet to Latex expression
  4. Unselect line with Latex expression
  5. Latex expression does not render

Minimal Reproducible Example

"$x + 5$"

Configuration

{
  "mark": [
    {
      "regex": "\"(.+?)\"",
      "class": "inside-quote",
      "hide": false,
      "flags": [
        "g",
        "i"
      ],
      "viewMode": {
        "reading": true,
        "source": true,
        "live": true
      }
    }
  ],
  "pattern": {
    "open": "{{open:(.*?)}}",
    "close": "{{close:(.*?)}}"
  }
}

Relevant log output

No response

Anything else?

Latex Suite was enabled to make testing easier, but did not affect the text rendering (same for Settings Search)

OS

Windows

Obsidian information

SYSTEM INFO:
    Obsidian version: v1.7.4
    Installer version: v1.6.7
    Operating system: Windows 11 Home 10.0.22621
    Login status: not logged in
    Language: en
    Insider build toggle: off
    Live preview: on
    Base theme: dark
    Community theme: none
    Snippets enabled: 3
    Restricted mode: off
    Plugins installed: 14
    Plugins enabled: 3
        1: Regex Mark v1.9.2
        2: Settings Search v1.3.10
        3: Latex Suite v1.9.5

RECOMMENDATIONS:
    Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
    Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

Plugin version

v1.9.2

Mara-Li commented 1 week ago

Well, not really surprised as latex is rendered specially in Obsidian. Some edge case here. Will check and see if I can do something!