Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MD036: doesn't fire when any HTML comment is present on the same line. #1267

Open
wwarriner opened this issue Jun 21, 2024 · 0 comments
Open

Comments

@wwarriner
Copy link

wwarriner commented Jun 21, 2024

Hey there, appreciate the linter and associated tooling and am using it for pre-commit hooks and CI/CD in our organization's documentation. Thank you!

I've discovered that MD036 doesn't fire when any HTML comment is present on the same line. I do not know if this is intended behavior and could not determine based on a cursory search of past issues (searching for MD036) nor the docs.

The rationale for MD036 says "Using emphasis instead of a heading prevents tools from inferring the structure of a document." If an HTML comment prevents this rule from firing, then the rationale is not achieved, as the comment should have no impact on inference. Unless there is tooling that uses comments to infer document structure? I honestly don't know, but it would surprise me.

To reproduce, create a markdown document with the following.

# Header

**Triggers MD036**

**Does not trigger MD036** <!-- -->

The output should look like the following, noting that line 5 is not present in the output.

markdownlint-cli2 v0.13.0 (markdownlint v0.34.0)
Finding: ./docs/test.md
Linting: 1 file(s)
Summary: 1 error(s)
docs/test.md:3 MD036/no-emphasis-as-heading Emphasis used instead of a heading [Context: "Triggers MD036"]

I hope this is helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants