[GH-ISSUE #48] Trailing space in paragraph bug #1886

Closed
opened 2026-03-07 20:02:26 +03:00 by kerem · 5 comments
Owner

Originally created by @thomasjbradley on GitHub (Mar 13, 2017).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/48

There seems to be a bug in the trailing space matching of some kind, but only errors when there’s front matter. I cannot recreate the error in the demo so it could also be related to resultVersion: 1.

This is the code that throws the error:

---
basic-card: |
  The basic card is used to showcase the dogs that are available for adoption. It includes a button but never links itself.
---

The cards provide a way to highlight and group important information. 

There’s a trailing space right at the end of “information. ” and this is the error I get:

TypeError: Cannot read property 'match' of undefined on line 258

If I strip the front matter it seems to work okay.


Version: 0.4.0

Originally created by @thomasjbradley on GitHub (Mar 13, 2017). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/48 There seems to be a bug in the trailing space matching of some kind, but only errors when there’s front matter. I cannot recreate the error in the demo so it could also be related to `resultVersion: 1`. This is the code that throws the error: ```md --- basic-card: | The basic card is used to showcase the dogs that are available for adoption. It includes a button but never links itself. --- The cards provide a way to highlight and group important information. ``` There’s a trailing space right at the end of “information. ” and this is the error I get: ``` TypeError: Cannot read property 'match' of undefined on line 258 ``` If I strip the front matter it seems to work okay. ---- **Version: 0.4.0**
kerem 2026-03-07 20:02:26 +03:00
Author
Owner

@thomasjbradley commented on GitHub (Mar 13, 2017):

Here’s my config:

{
  "header-increment": false,
  "first-header-h1": false,
  "header-style": {
    "style": "atx"
  },
  "no-missing-space-atx": true,
  "no-multiple-space-atx": true,
  "blanks-around-headers": true,
  "header-start-left": true,
  "no-duplicate-header": false,
  "single-h1": true,
  "no-trailing-punctuation": {
    "punctuation": ",;:"
  },
  "ul-style": {
    "style": "dash"
  },
  "list-indent": true,
  "ul-start-left": true,
  "ul-indent": {
    "indent": 2
  },
  "ol-prefix": {
    "style": "ordered"
  },
  "list-marker-space": {
    "ul_single": 1,
    "ol_single": 1,
    "ul_multi": 1,
    "ol_multi": 1
  },
  "blanks-around-lists": true,
  "no-trailing-spaces": {
    "br_spaces": 0
  },
  "no-hard-tabs": true,
  "no-reversed-links": true,
  "no-multiple-blanks": true,
  "line-length": false,
  "commands-show-output": true,
  "no-multiple-space-blockquote": true,
  "no-blanks-blockquote": true,
  "blanks-around-fences": true,
  "no-inline-html": false,
  "no-bare-urls": true,
  "hr-style": {
    "style": "---"
  },
  "no-emphasis-as-header": true,
  "no-space-in-emphasis": true,
  "no-space-in-code": true,
  "no-space-in-links": true,
  "fenced-code-language": true,
  "first-line-h1": false,
  "no-empty-links": true
}
<!-- gh-comment-id:286241992 --> @thomasjbradley commented on GitHub (Mar 13, 2017): Here’s my config: ```json { "header-increment": false, "first-header-h1": false, "header-style": { "style": "atx" }, "no-missing-space-atx": true, "no-multiple-space-atx": true, "blanks-around-headers": true, "header-start-left": true, "no-duplicate-header": false, "single-h1": true, "no-trailing-punctuation": { "punctuation": ",;:" }, "ul-style": { "style": "dash" }, "list-indent": true, "ul-start-left": true, "ul-indent": { "indent": 2 }, "ol-prefix": { "style": "ordered" }, "list-marker-space": { "ul_single": 1, "ol_single": 1, "ul_multi": 1, "ol_multi": 1 }, "blanks-around-lists": true, "no-trailing-spaces": { "br_spaces": 0 }, "no-hard-tabs": true, "no-reversed-links": true, "no-multiple-blanks": true, "line-length": false, "commands-show-output": true, "no-multiple-space-blockquote": true, "no-blanks-blockquote": true, "blanks-around-fences": true, "no-inline-html": false, "no-bare-urls": true, "hr-style": { "style": "---" }, "no-emphasis-as-header": true, "no-space-in-emphasis": true, "no-space-in-code": true, "no-space-in-links": true, "fenced-code-language": true, "first-line-h1": false, "no-empty-links": true } ```
Author
Owner

@DavidAnson commented on GitHub (Mar 13, 2017):

I have an idea. I'll take a look tonight. Sorry for the trouble!

<!-- gh-comment-id:286247662 --> @DavidAnson commented on GitHub (Mar 13, 2017): I have an idea. I'll take a look tonight. Sorry for the trouble!
Author
Owner

@thomasjbradley commented on GitHub (Mar 14, 2017):

No problem at all—thanks for being so responsive.

<!-- gh-comment-id:286300293 --> @thomasjbradley commented on GitHub (Mar 14, 2017): No problem at all—thanks for being so responsive.
Author
Owner

@DavidAnson commented on GitHub (Mar 14, 2017):

I can reproduce this problem. It is related to resultVersion. I should have a fix tomorrow evening. I'll be releasing 0.4.1 soon with this fix. Thanks!

<!-- gh-comment-id:286321861 --> @DavidAnson commented on GitHub (Mar 14, 2017): I can reproduce this problem. It is related to `resultVersion`. I should have a fix tomorrow evening. I'll be releasing `0.4.1` soon with this fix. Thanks!
Author
Owner

@thomasjbradley commented on GitHub (Mar 14, 2017):

Thanks so much!

<!-- gh-comment-id:286414219 --> @thomasjbradley commented on GitHub (Mar 14, 2017): Thanks so much!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#1886
No description provided.