Skip to content

scope: sentence existence rule fires inside inline code spans when bold text precedes them in indented blocks #1084

@theletterf

Description

@theletterf

Check for existing issues

  • Completed

Environment

  • Vale version: 3.13.1
  • Operating system: macOS 25.3.0
  • Installation method: Homebrew

Describe the bug / provide steps to reproduce it

When an existence rule uses scope: sentence, the IgnoredScopes = code setting is not honored for inline code spans that appear on lines where bold text (**...**) also appears inside a Markdown indented code block (4-space indent) — provided the preceding heading itself contains an inline code span.

In other words, a semicolon (or any other token) inside a backtick-wrapped inline code span is incorrectly flagged when all three conditions are met simultaneously:

  1. A heading with an inline code span immediately precedes the block (e.g., ### `some.code`).
  2. The following content is a 4-space indented line (standard Markdown indented code block).
  3. That line contains bold text (**...**) and an inline code span with the flagged token.

Minimal reproduction

styles/Test/Semicolons.yml:

extends: existence
message: "Use semicolons judiciously."
nonword: true
scope: sentence
level: suggestion
tokens:
  - ';'

.vale.ini:

StylesPath = styles
MinAlertLevel = suggestion
SkippedScopes = script, style, pre, code
IgnoredScopes = tt, code, strong, b

[*.md]
BasedOnStyles = Test

test.md:

### `setup.ilm.enabled` [setup-ilm-option]

    *   **bold text** `inline code with semicolon;`

Run:

vale test.md

Expected: No output — the semicolon is inside an inline code span, which should be excluded by IgnoredScopes = code.

Actual:

test.md
 3:41  suggestion  Use semicolons judiciously.  Test.Semicolons

Additional observations

Removing any one of the three conditions prevents the false positive:

  • Removing the inline code span from the heading → no alert.
  • Removing the 4-space indentation → no alert.
  • Removing the bold text from the indented line → no alert.

A standalone inline code span on a non-indented line correctly produces no alert:

`inline code with semicolon;`

This suggests the bug is in how scope: sentence sentence extraction interacts with IgnoredScopes when bold markup and inline code co-occur inside indented blocks that follow a heading containing inline code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions