Skip to content

--ellipsis corrupts literal '...' inside indented (4-space) code blocks #369

Description

@lodyai

Summary

mdtablefix --ellipsis rewrites literal ... to the Unicode ellipsis
inside indented (four-space) code blocks. Indented code blocks are not
protected the way fenced blocks and inline code are, so literal example
content (command output, source snippets) is silently corrupted.

Version

mdtablefix 0.4.0

Reproduction

Input (ellipsis.md):

# Ellipsis repro

Expected test output:

    running 2 tests
    test foo ... ok
    test bar ... ok
    ...
    test result: ok

Inline code is fine: `foo(...)` stays literal.

```text
fenced ... stays literal
```

Command:

mdtablefix --wrap --renumber --breaks --ellipsis --fences --in-place ellipsis.md

Actual behaviour

The indented code block is rewritten (inline code and the fenced block are
correctly left alone):

<     test foo ... ok
<     test bar ... ok
<     ...
---
>     test foo … ok
>     test bar … ok
>

Expected behaviour

Indented code blocks should be treated as literal, exactly like fenced code
blocks and inline code spans. ... inside an indented code block must not be
converted to .

Impact

This is a silent semantic break: the corrupted content is real code / command
output, and because the resulting lines are usually under 80 columns,
markdownlint does not flag it. Real-world hits were sample cargo test output
(test ... ok) and a Rust snippet whose string literals "..." became "…".

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