question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MD046 - Triggers violation incorrectly

See original GitHub issue

I’ve been using markdownlint-cli in my docs repositories. I upgraded from version 0.15.0 to latest (0.21.0), which makes the rule MD046 available.

This rule seems to be triggering violations incorrectly. Below is a snippet of content. Please ignore the \ at the beginning of code block fences. I added those so that the entire snippet below gets rendered together on github.


* Edit `path/to/file.xml` and add the following line beneath `<!-- Add new files`:

\```xml
<file>META-INF/filename.xml</file>
\```

* Create a new interface in `src/main/java` called `com.example.tc.TermsAndConditionService`.

* Add the following method definitions to the interface: _(**Hint:** don't forget to define each method with javadoc comments)_

\```java
a snippet of java code here
\```

MD046 rule is complaining about the following line:

* Create a new interface in `src/main/java` called `com.example.tc.TermsAndConditionService`.

The error message is:

$ markdownlint ../docs/ ./versioned_docs/
../docs/path/to/doc.md:43 MD046/code-block-style Code block style [Expected: fenced; Actual: indented]

Notice that the line it is reporting problem does not have code blocks. It only has inline code wrapped with backticks. I’m getting similar errors being reported on a lot of other lines.

I’ve checked the existing issues related to MD046 but they didn’t seem to mention the type of issues I’ve explained here. Hopefully this is not a duplicate issue.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:19 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
DavidAnsoncommented, Apr 6, 2020

Maybe 1 week for the library and 2 more for the CLI?

1reaction
DavidAnsoncommented, Mar 10, 2020

Cool. The general guideline I use is that content of a list item should be indented to match the list marker. That is usually 2 spaces for unordered lists and 3 spaces for ordered lists.

The spec has a lot more detail: https://spec.commonmark.org/0.29/#list-items

Read more comments on GitHub >

github_iconTop Results From Across the Web

Markdownlint Rules
This rule is triggered when you skip heading levels in a markdown document, ... Rationale: Violations of this rule can lead to improperly...
Read more >
Markdownlint - Visual Studio Marketplace
When editing a Markdown file in Code with markdownlint installed, any lines that violate one of markdownlint 's rules (see below) will trigger...
Read more >
markdown的语法-英文_剑之所向的博客
This rule is triggered when you skip heading levels in a markdown document, for example: # Heading 1. ### Heading 3.
Read more >
Office of the City Clerk - Record #: O2013-1640
L. A violation of law that results in a guilty plea, a plea of nolo ... suits, and causes of action against the...
Read more >
State of South Carolina Monitoring Strategy - SCDHEC
1.2.3 Identifying causes and sources of water quality impairments ... within these areas and outlining penalties for harvest violations.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found