Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown: Fenced block in list breaks ignoring spelling of LaTeX/TeX-style commands #128

Closed
jaceglassbrook opened this issue Mar 18, 2018 · 3 comments
Labels

Comments

@jaceglassbrook
Copy link

I'm using Markdown to write documents that include LaTeX/TeX math blocks. Spell Right successfully ignores LaTeX/TeX-style commands ... until you use a fenced block in a list. This doesn't seem to break simple ignoreRegExps and ignoreRegExpsByClass settings. The short document below should duplicate this behavior.

Example settings:

// a simple user-defined rule
"spellright.ignoreRegExps": [ "/fabloozle/ig" ]

Example document:

# This document breaks *Spell Right*

Fabloozle is my made-up word. Here's a fenced math block. *Spell Right* works.

```math
\dfrac{2}{4} \Rightarrow \dfrac{1}{2}
```

Here's a list with a fenced block:

-   Fabloozle. Here's the same math, but inline.
    *Spell Right* still works: $`\dfrac{2}{4} \Rightarrow \dfrac{1}{2}`$.

-   Here's the same math, again as a fenced block.
    Now *Spell Right* does *not* work for ``\foo``-style commands:

    ```math
    \dfrac{2}{4} \Rightarrow \dfrac{1}{2}
    ```
    <!-- leaving this fenced block empty also breaks *Spell Right* -->

Yet again, here's the same fenced math block.
*Spell Right* still does *not* work for ``\foo``-style commands.

```math
\dfrac{2}{4} \Rightarrow \dfrac{1}{2}
```

Fabloozle. *Spell Right* still seems to work for simple user-defined
``spellright.ignoreRegExps`` and ``spellright.ignoreRegExpsByClass`` settings.
@jaceglassbrook
Copy link
Author

Using the following rule works around this problem for now.

"spellright.ignoreRegExpsByClass": {
  "markdown": [ "/(\\\\\\[a-z]+)/ig" ]

@bartosz-antosik
Copy link
Owner

Thanks for committing! I have not yet looked into this one.

@bartosz-antosik
Copy link
Owner

This should be corrected in version 2.1.34. Please have a look and tell me whether it does.

My resolution, as few other earlier is a heuristics that should work the case.

Markdown is very tricky though. It would call for a proper parser but there is so many varieties of Markdown out there that it is nearly impossible to do anything about this. Even VSCode itself is sometimes inconsistent about Markdown, as you can see e.g. here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants