pymarkdown icon indicating copy to clipboard operation
pymarkdown copied to clipboard

Improper handling of missing table delimiter row

Open jpsoultanis-kapa opened this issue 1 week ago • 0 comments

Prerequisites

  • [x] Are you running the latest version of this application?
  • [x] Have you checked the Frequently Asked Questions document?
  • [x] Have you simplified the bug report to the essential details?
    • [x] Do you have a distinct command line to report?
    • [x] Can you clearly state the configuration for this bug report?
    • [x] Do you have a minimal document that highlights this bug?
    • [x] Are any required files (configuration or Markdown document) attached to the issue?
  • [x] Did you perform a cursory search of other issues to look for related issues?

Bug Report

Bug Type

  • [ ] Assertion Failure
  • [ ] Documentation
  • [x] Scan/Rule not working as expected
  • [x] Fix/Rule not working as expected
  • [ ] Other [Other reason]

Description

My understanding of CommonMark and GFM is that a delimiter row is required in table markdown declarations (apologies if this is incorrect). PyMarkdownLnt's APIs scan_string() and fix_string() don't detect a problem or fix a markdown table that is missing a delimiter row:

invalid_md = """
# Test

| Name  | Age | City  |
| Alice | 30  | NY    |
| Bob   | 25  | SF    |
"""

PyMarkdownApi().scan_string(invalid_md)

# returns PyMarkdownScanPathResult(scan_failures=[], pragma_errors=[])

Specifics

What operating system and version are you running into this behavior on?

MacOS 15.3

What version are you seeing this behavior in? (Run pip list or pipenv run pip list and look for the entry beside pymarkdownlnt.)

0.9.28

Are there any extra steps that need to be taken before executing the application?

No

What is the command line you invoke to get this behavior?

See Description section above with code sample.

Are you using a configuration file? Either on the command line or one of the implicit configuration files? If so, attach that file to this issue.

No

What Markdown document causes this behavior to manifest? Attach that file to this issue.

See Description section above with code sample.

Actual Behavior

The scan detects no error and performs no fix.

Expected Behavior

The scan detects a missing delimiter row, or would insert one.

jpsoultanis-kapa avatar Feb 18 '25 16:02 jpsoultanis-kapa