Skip to content

Commit

Permalink
fix for multiple trailing spaces after 'correct'
Browse files Browse the repository at this point in the history
  • Loading branch information
fasttime committed Nov 20, 2023
1 parent e9788b6 commit dba855e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/tools/markdown-it-rule-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function markdownItRuleExample({ open, close }) {
return typeof text === "string" ? text : "";
}

const { type, parserOptionsJSON } = /^\s*(?<type>\S+)(\s+(?<parserOptionsJSON>.+?))?\s*$/u.exec(tagToken.info).groups;
const { type, parserOptionsJSON } = /^\s*(?<type>\S+)(\s+(?<parserOptionsJSON>\S.*?))?\s*$/u.exec(tagToken.info).groups;
const parserOptions = { sourceType: "module", ...(parserOptionsJSON && JSON.parse(parserOptionsJSON)) };
const codeBlockToken = tokens[index + 1];

Expand Down
9 changes: 9 additions & 0 deletions tests/fixtures/good-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ const foo = <bar></bar>;

:::

A test with multiple spaces after 'correct':
<!-- markdownlint-disable-next-line no-trailing-spaces -->
:::correct

```js
```

:::

The following code block is not a rule example, so it won't be checked:

```js
Expand Down

0 comments on commit dba855e

Please sign in to comment.