Skip to content

check_spelling() unable to handle dubble trailing backslash \\ #107

@wlangera

Description

@wlangera

I get an error for the check_spelling() function when trailing backslashes are in my text or in my mathematical formulas.
Some examples of text that generate the errors:

This is a sentence \\

Creates the following error:

Error in gregexpr(spelling_clean_problem(word), text[i]) : 
  invalid regular expression '\\\', reason 'Trailing backslash

--
This is a sentence\\

Creates the following error:

Error in gregexpr(spelling_clean_problem(word), text[i]) : 
invalid regular expression 'sentence\\\', reason 'Trailing backslash'

--
\\ This is a sentence

Creates the following error:

Error in gregexpr(spelling_clean_problem(word), text[i]) : 
  invalid regular expression '\\\', reason 'Trailing backslash

--

$$
p(\mathbf{z_i}) = \begin{cases}
      \int_0^W\frac{2r}{W^2}g(r, \mathbf{z_i};\boldsymbol \theta)\,dr, & \text{punttransecten} \\
      \int_0^W\frac{1}{W}g(r, \mathbf{z_i};\boldsymbol \theta)\,dr, & \text{lijntransecten}
    \end{cases}
$$

Creates the following error:

Error in gregexpr(spelling_clean_problem(word), text[i]) : 
  invalid regular expression '\\\', reason 'Trailing backslash

Kind regards,
Ward

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions