mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Improve MD038/no-space-in-code to allow single-spaces surrounding a code inline with internal spaces (fixes #277).
This commit is contained in:
parent
2ae29e2b9e
commit
bdc0246b34
2 changed files with 11 additions and 2 deletions
|
@ -7,7 +7,7 @@ const { addErrorContext, filterTokens, forEachInlineCodeSpan, newLineRe } =
|
|||
|
||||
const leftSpaceRe = /^\s([^`]|$)/;
|
||||
const rightSpaceRe = /[^`]\s$/;
|
||||
const singleLeftRightSpaceRe = /^\s\S+\s$/;
|
||||
const singleLeftRightSpaceRe = /^\s(?:\S.*\S|\S)\s$/;
|
||||
|
||||
module.exports = {
|
||||
"names": [ "MD038", "no-space-in-code" ],
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
`codespan element with space inside right ` {MD038}
|
||||
|
||||
` codespan element with spaces inside ` {MD038}
|
||||
` codespan element with spaces inside ` (allowed per spec)
|
||||
|
||||
empty `` codespan element
|
||||
|
||||
|
@ -111,3 +111,12 @@ Double start and single end space: ` code ` {MD038}
|
|||
Single start and double end spaces: ` code ` {MD038}
|
||||
|
||||
Double start and end spaces: ` code ` {MD038}
|
||||
|
||||
Spaces before and after: ` codecode `
|
||||
As above, with an internal space: ` code code `
|
||||
As above, practical example with a backtick: `` Ctrl + ` ``
|
||||
As above, no internal space: `` Ctrl+` ``
|
||||
Again, 3 characters: ` abc `
|
||||
Again, 2 characters: ` ab `
|
||||
Again, 1 character: ` a `
|
||||
Many internal spaces: ` code code code code code code `
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue