rojopolis / spellcheck-github-actions

Spell check action
MIT License
138 stars 38 forks source link

Markdown with html #156

Closed JobaDiniz closed 1 year ago

JobaDiniz commented 1 year ago

Markdown

# About
The IBM® RPA Command Line Interface (RPA CLI) is an *unofficial* tool that provides a interface to manage and deploy IBM® RPA projects. RPA CLI commands are covered in the accompanying user guide, including descriptions, syntax, and usage examples.

<div>
  <ol class="card-list">
    <li class="card">
      <div class="inner-card">
        <div class="card-header">
          <div class="inner-card-header">
            <h3>
              <a href="#/guide/readme"><span>User Guide</span></a>
            </h3>
          </div>
        </div>
        <div class="card-section" style="width: 100%;">
          <div class="card-section-content">
            <div>
              <div class="inner-content">
                 Describes all the RPA CLI concepts and provides instructions on using the various features of the latest version of the RPA CLI.
              </div>
            </div>
          </div>
        </div>
      </div>
    </li>
    <li class="card">
      <div class="inner-card">
        <div class="card-header">
          <div class="inner-card-header">
            <h3>
              <a href="#reference"><span>Command Reference</span></a>
            </h3>
          </div>
        </div>
        <div class="card-section" style="width: 100%;">
          <div class="card-section-content">
            <div>
              <div class="inner-content">
                 Describes the latest version of the RPA CLI in detail and provides basic syntax, options, and usage examples for each operation.
              </div>
            </div>
          </div>
        </div>
      </div>
    </li>
  </ol>
</div>

# Author
...

I get these mispells

Misspelled words:
<markdown> docs/README.md
--------------------------------------------------------------------------------
getpino
githubusercontent
href
https
img
ol
readme
src

How can I tell this tool to skip HTML within markdown?

I've tried using pymdownx.striphtml and pymdownx.superfences extensions, but it does not work.

matrix:
- name: Markdown
  aspell:
    lang: en
    ignore-case: true
  dictionary:
    wordlists:
    - spellcheck/wordlist.txt
    encoding: utf-8
  pipeline:
  - pyspelling.filters.markdown:
      markdown_extensions:
      - pymdownx.striphtml
      - pymdownx.superfences
  sources:
  - 'docs/*.md'
  default_encoding: utf-8
jonasbn commented 1 year ago

Hi @JobaDiniz

Could you try with the following configuration

matrix:
- name: Markdown
  aspell:
    lang: en
    ignore-case: true
  dictionary:
    wordlists:
    - spellcheck/wordlist.txt
    encoding: utf-8
  pipeline:
  - pyspelling.filters.markdown:
      markdown_extensions:
      - pymdownx.striphtml
      - pymdownx.superfences
  - pyspelling.filters.html:
      comments: false
      ignores:
      - code
      - pre
  sources:
  - 'docs/*.md'
  default_encoding: utf-8

Then I get the following:

Using pyspelling on configuration outlined in >spellcheck.yaml<
Checking files matching specified outlined in >spellcheck.yaml<
----------------------------------------------------------------
Using aspell to spellcheck Markdown
Running Task: Markdown...
Compiling Dictionary...
> Processing: example.md
Misspelled words:
<htmlcontent> example.md: html>body>p
--------------------------------------------------------------------------------
CLI
RPA
--------------------------------------------------------------------------------

Misspelled words:
<htmlcontent> example.md: html>body>div>ol>li>div>div>div>div>div.inner-content
--------------------------------------------------------------------------------
CLI
RPA
--------------------------------------------------------------------------------

Misspelled words:
<htmlcontent> example.md: html>body>div>ol>li>div>div>div>div>div.inner-content
--------------------------------------------------------------------------------
CLI
RPA
--------------------------------------------------------------------------------

!!!Spelling check failed!!!
::error title=Spelling errors::Files in repository contain spelling errors
Spellcheck failed

Then add CLI and RPA to you wordlist, since these are actual words.

jonasbn commented 1 year ago

Hi @JobaDiniz

I will close this issue, let me know if need additional support with you issue. If you experience anything else that require assistance please open an new issue.

Have a nice weekend