pymarkdown icon indicating copy to clipboard operation
pymarkdown copied to clipboard

MD013 incompatible with tables.

Open BorekZnovustvoritel opened this issue 1 year ago • 5 comments

There is no existing options to disable MD013 (line length) on tables. This is an option in the project markdownlint and the docs on this rule claims that inspiration was taken from Markdownlint.

Other solution to this issue would be to enable multiline pragmas, but that is unavailable either.

As a result, the linter always reports MD013 violation on tables longer than the globally set value. Reformatting the table is not an option, because newlines create new table rows instead.

BorekZnovustvoritel avatar Oct 11 '23 12:10 BorekZnovustvoritel

Hey, I'd like to bump this issue up. We're happy to work on this and open a pull request, given some guidance.

kosciCZ avatar Nov 03 '23 08:11 kosciCZ

It is somewhat buried, hence the issue to fix documentation...

use a pragma of disable-num-lines 3 md013 instead of disable-next-line md013 before the table, and it should suppress the error. This was just added in the 0.9.14 release.

jackdewinter avatar Nov 04 '23 14:11 jackdewinter

Any comments back on whether that worked for both cases?

The next minor release is all bug fixes, and the one after that is adding new features. Primarily extensions and rule fixes. One of those is tables, but it may be pushed out another release as it is adding a leaf token which requires tons more testing.

jackdewinter avatar Dec 01 '23 19:12 jackdewinter

Hello, thanks for the answer. We are looking forward to being able to use the new features as we consider problematic having the table lengths hardcoded. Your solution would most certainly work right now, but it simply is harder to maintain. If you expect to introduce the table support in the future, we will most certainly want to use that option even if it requires a little bit of patience.

Thank you for your support!

BorekZnovustvoritel avatar Dec 05 '23 08:12 BorekZnovustvoritel

Just to confirm, using:

<!-- pyml disable-num-lines 7 md013 -->

... does allow "wide" tables to pass linting.

However, I agree with @BorekZnovustvoritel that this is particularly clunky. It would be great to be able to use a setting like:

plugins.line-length.tables = false

... if possible 🙏🏻

jamescooke avatar Mar 21 '24 15:03 jamescooke