Skip to content

Issues with flyspell mode in code blocks #311

@phst

Description

@phst

Code in code blocks is incorrectly treated as spelling error by Flyspell.

Expected Behavior

Code in code blocks is never treated as spelling error.

Actual Behavior

Code in code blocks is occasionally treated as spelling error (see reproduction steps below).

Steps to Reproduce

  1. Start Emacs and load markdown-mode.
  2. Visit a nonexisting Markdown file.
  3. Enable flyspell-mode (M-x flyspell-mode)
  4. Insert a code block with nonexisting words, such as
    ```aaa
    bbb
    ```

"aaa" and "bbb" will now get the red Flyspell underline because they are spelling errors, but Flyspell should ignore code. Interestingly, markdown-flyspell-check-word-p returns nil inside the code block, i.e. it's detected correctly. Saving and then reverting the buffer using M-x revert-buffer doesn't help. Only turning Flyspell mode off and on again (by hitting M-x flyspell-mode twice) works.

Software Versions

  • Markdown Mode: From Git on 2018-01-24, version 2.4-dev
  • Emacs: GNU Emacs 27.0.50 (build 5, x86_64-pc-linux-gnu, GTK+ Version 3.22.24) of 2018-01-24
  • OS: Debian testing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions