Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAnson committed Feb 8, 2025
1 parent cbc3bc4 commit a41024f
Show file tree
Hide file tree
Showing 6 changed files with 168 additions and 146 deletions.
24 changes: 12 additions & 12 deletions doc-build/md038.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This rule is triggered for code spans that have content with unnecessary spaces
This rule is triggered for code spans containing content with unnecessary space
next to the beginning or ending backticks:

```markdown
Expand All @@ -9,21 +9,12 @@ next to the beginning or ending backticks:
` some text `
```

To fix this, remove extra spaces from the beginning or ending:
To fix this, remove the extra space characters from the beginning and ending:

```markdown
`some text`
```

Note: Code spans containing only spaces are allowed by the specification and are
preserved:

```markdown
` `

` `
```

Note: A single leading *and* trailing space is allowed by the specification and
trimmed by the parser to support code spans that begin or end with a backtick:

Expand All @@ -34,11 +25,20 @@ trimmed by the parser to support code spans that begin or end with a backtick:
```

Note: When single-space padding is present in the input, it will be preserved
even if unnecessary:
(even if unnecessary):

```markdown
` code `
```

Note: Code spans containing only spaces are allowed by the specification and are
also preserved:

```markdown
` `

` `
```

Rationale: Violations of this rule are usually unintentional and can lead to
improperly-rendered content.
24 changes: 12 additions & 12 deletions doc/Rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -1528,7 +1528,7 @@ Aliases: `no-space-in-code`

Fixable: Some violations can be fixed by tooling

This rule is triggered for code spans that have content with unnecessary spaces
This rule is triggered for code spans containing content with unnecessary space
next to the beginning or ending backticks:

```markdown
Expand All @@ -1539,21 +1539,12 @@ next to the beginning or ending backticks:
` some text `
```

To fix this, remove extra spaces from the beginning or ending:
To fix this, remove the extra space characters from the beginning and ending:

```markdown
`some text`
```

Note: Code spans containing only spaces are allowed by the specification and are
preserved:

```markdown
` `

` `
```

Note: A single leading *and* trailing space is allowed by the specification and
trimmed by the parser to support code spans that begin or end with a backtick:

Expand All @@ -1564,12 +1555,21 @@ trimmed by the parser to support code spans that begin or end with a backtick:
```

Note: When single-space padding is present in the input, it will be preserved
even if unnecessary:
(even if unnecessary):

```markdown
` code `
```

Note: Code spans containing only spaces are allowed by the specification and are
also preserved:

```markdown
` `

` `
```

Rationale: Violations of this rule are usually unintentional and can lead to
improperly-rendered content.

Expand Down
24 changes: 12 additions & 12 deletions doc/md038.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Aliases: `no-space-in-code`

Fixable: Some violations can be fixed by tooling

This rule is triggered for code spans that have content with unnecessary spaces
This rule is triggered for code spans containing content with unnecessary space
next to the beginning or ending backticks:

```markdown
Expand All @@ -17,21 +17,12 @@ next to the beginning or ending backticks:
` some text `
```

To fix this, remove extra spaces from the beginning or ending:
To fix this, remove the extra space characters from the beginning and ending:

```markdown
`some text`
```

Note: Code spans containing only spaces are allowed by the specification and are
preserved:

```markdown
` `

` `
```

Note: A single leading *and* trailing space is allowed by the specification and
trimmed by the parser to support code spans that begin or end with a backtick:

Expand All @@ -42,11 +33,20 @@ trimmed by the parser to support code spans that begin or end with a backtick:
```

Note: When single-space padding is present in the input, it will be preserved
even if unnecessary:
(even if unnecessary):

```markdown
` code `
```

Note: Code spans containing only spaces are allowed by the specification and are
also preserved:

```markdown
` `

` `
```

Rationale: Violations of this rule are usually unintentional and can lead to
improperly-rendered content.
4 changes: 2 additions & 2 deletions lib/md038.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default {
addErrorContext(
onError,
startData.startLine,
startData.text,
codeText.text,
true,
false,
[ startColumn, length ],
Expand All @@ -56,7 +56,7 @@ export default {
addErrorContext(
onError,
endData.endLine,
endData.text,
codeText.text,
false,
true,
[ endColumn - length, length ],
Expand Down
Loading

0 comments on commit a41024f

Please sign in to comment.