You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When there are only spaces, it's very likely that they're intentional. That premise for MD038 is to avoid unintentional whitespace.
And it's even more likely that the automatic fix is much less intentional: markdownlint --fix removes all spaces.
This results in an empty code span, which is not even a valid code span. Thus the fix definitely changes semantics.
In my opinion the fix behaviour is wrong. The rule violation maybe not as clearly wrong, but I'd suggest to exempt code spans with only spaces from MD038.
Original:
``````
Original, rendered in GitHub:
Result of markdownlint --fix:
``
``
``
Result of markdownlint --fix, rendered in GitHub:
``
``
``
The text was updated successfully, but these errors were encountered:
When a code span contains only spaces, I think MD038 should not apply.
CommonMark describes that case to be taken as is without chopping off leading or trailing spaces (https://spec.commonmark.org/0.31.2/#code-spans).
When there are only spaces, it's very likely that they're intentional. That premise for MD038 is to avoid unintentional whitespace.
And it's even more likely that the automatic fix is much less intentional:
markdownlint --fix
removes all spaces.This results in an empty code span, which is not even a valid code span. Thus the fix definitely changes semantics.
In my opinion the fix behaviour is wrong. The rule violation maybe not as clearly wrong, but I'd suggest to exempt code spans with only spaces from MD038.
Original:
Original, rendered in GitHub:
Result of
markdownlint --fix
:Result of
markdownlint --fix
, rendered in GitHub:The text was updated successfully, but these errors were encountered: