tani / textlint-rule-spelling

A textlint rule for spellings of languages as much as possible
GNU General Public License v3.0
8 stars 5 forks source link

Skip link #7

Closed jeff-cook closed 3 years ago

jeff-cook commented 4 years ago

Is there an easy way to have textlint-rule-spelling skip spell check on all links?

Example

![WARNING:](images/warning_25x25_red.svg)
tani commented 4 years ago

Sorry for late reply. The skipPatterns accepts regular expressions. Thus, !\\[.*?\\]\\(.*?\\).

jeff-cook commented 4 years ago

Here are the config and output.

rules:
  spelling:
    skipPatterns:
      - svg
      - \\!\\[.*?\\]\\(.*?\\)
spelling: svg -> avg, sag, SVN, VG
/work/README.md:5:1
       v
    4. 
    5. ![build](../../build/badges/master/pipeline.svg)
    6. 
       ^

textlint --version v11.6.3

"textlint-rule-spelling": "0.1.1"

zoechi commented 4 years ago

Wouldn't it be better to allow skipping node types? From https://github.com/textlint/textlint/blob/master/docs/txtnode.md - "Link" "Code" "CodeBlock" ... node types.

Like skip in https://github.com/sapegin/textlint-rule-terminology

tani commented 4 years ago

@jeff-cook @zoechi Thank you for nice comments. However, the past contribution #9 solved this issue. If you have a time, please check it and give feedbacks.