mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-01-27 17:36:10 +01:00
Update MD039/no-space-in-links to not remove code/emphasis markers when fixing issues (fixes #482).
This commit is contained in:
parent
a8f946e0b3
commit
7bb80d19b1
6 changed files with 207 additions and 5 deletions
17
test/detailed-results-spaces-inside-link-text.md
Normal file
17
test/detailed-results-spaces-inside-link-text.md
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# Spaces Inside Link Text
|
||||
|
||||
[ link ](https://example.com/) {MD039}
|
||||
|
||||
[ "link" ](https://example.com/) {MD039}
|
||||
|
||||
[ `link` ](https://example.com/) {MD039}
|
||||
|
||||
[ *link* ](https://example.com/) {MD039}
|
||||
|
||||
[ __link__ ](https://example.com/) {MD039}
|
||||
|
||||
[ link "link" ](https://example.com/) {MD039}
|
||||
|
||||
[ link `link` ](https://example.com/) {MD039}
|
||||
|
||||
[ *link* link ](https://example.com/) {MD039}
|
||||
17
test/detailed-results-spaces-inside-link-text.md.fixed
Normal file
17
test/detailed-results-spaces-inside-link-text.md.fixed
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# Spaces Inside Link Text
|
||||
|
||||
[link](https://example.com/) {MD039}
|
||||
|
||||
["link"](https://example.com/) {MD039}
|
||||
|
||||
[`link`](https://example.com/) {MD039}
|
||||
|
||||
[*link*](https://example.com/) {MD039}
|
||||
|
||||
[__link__](https://example.com/) {MD039}
|
||||
|
||||
[link "link"](https://example.com/) {MD039}
|
||||
|
||||
[link `link`](https://example.com/) {MD039}
|
||||
|
||||
[*link* link](https://example.com/) {MD039}
|
||||
162
test/detailed-results-spaces-inside-link-text.results.json
Normal file
162
test/detailed-results-spaces-inside-link-text.results.json
Normal file
|
|
@ -0,0 +1,162 @@
|
|||
[
|
||||
{
|
||||
"errorContext": "[ link ]",
|
||||
"errorDetail": null,
|
||||
"errorRange": [
|
||||
1,
|
||||
8
|
||||
],
|
||||
"fixInfo": {
|
||||
"deleteCount": 6,
|
||||
"editColumn": 2,
|
||||
"insertText": "link"
|
||||
},
|
||||
"lineNumber": 3,
|
||||
"ruleDescription": "Spaces inside link text",
|
||||
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md039",
|
||||
"ruleNames": [
|
||||
"MD039",
|
||||
"no-space-in-links"
|
||||
]
|
||||
},
|
||||
{
|
||||
"errorContext": "[ \"link\" ]",
|
||||
"errorDetail": null,
|
||||
"errorRange": [
|
||||
1,
|
||||
10
|
||||
],
|
||||
"fixInfo": {
|
||||
"deleteCount": 8,
|
||||
"editColumn": 2,
|
||||
"insertText": "\"link\""
|
||||
},
|
||||
"lineNumber": 5,
|
||||
"ruleDescription": "Spaces inside link text",
|
||||
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md039",
|
||||
"ruleNames": [
|
||||
"MD039",
|
||||
"no-space-in-links"
|
||||
]
|
||||
},
|
||||
{
|
||||
"errorContext": "[ `link` ]",
|
||||
"errorDetail": null,
|
||||
"errorRange": [
|
||||
1,
|
||||
10
|
||||
],
|
||||
"fixInfo": {
|
||||
"deleteCount": 8,
|
||||
"editColumn": 2,
|
||||
"insertText": "`link`"
|
||||
},
|
||||
"lineNumber": 7,
|
||||
"ruleDescription": "Spaces inside link text",
|
||||
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md039",
|
||||
"ruleNames": [
|
||||
"MD039",
|
||||
"no-space-in-links"
|
||||
]
|
||||
},
|
||||
{
|
||||
"errorContext": "[ *link* ]",
|
||||
"errorDetail": null,
|
||||
"errorRange": [
|
||||
1,
|
||||
10
|
||||
],
|
||||
"fixInfo": {
|
||||
"deleteCount": 8,
|
||||
"editColumn": 2,
|
||||
"insertText": "*link*"
|
||||
},
|
||||
"lineNumber": 9,
|
||||
"ruleDescription": "Spaces inside link text",
|
||||
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md039",
|
||||
"ruleNames": [
|
||||
"MD039",
|
||||
"no-space-in-links"
|
||||
]
|
||||
},
|
||||
{
|
||||
"errorContext": "[ __link__ ]",
|
||||
"errorDetail": null,
|
||||
"errorRange": [
|
||||
1,
|
||||
12
|
||||
],
|
||||
"fixInfo": {
|
||||
"deleteCount": 10,
|
||||
"editColumn": 2,
|
||||
"insertText": "__link__"
|
||||
},
|
||||
"lineNumber": 11,
|
||||
"ruleDescription": "Spaces inside link text",
|
||||
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md039",
|
||||
"ruleNames": [
|
||||
"MD039",
|
||||
"no-space-in-links"
|
||||
]
|
||||
},
|
||||
{
|
||||
"errorContext": "[ link \"link\" ]",
|
||||
"errorDetail": null,
|
||||
"errorRange": [
|
||||
1,
|
||||
15
|
||||
],
|
||||
"fixInfo": {
|
||||
"deleteCount": 13,
|
||||
"editColumn": 2,
|
||||
"insertText": "link \"link\""
|
||||
},
|
||||
"lineNumber": 13,
|
||||
"ruleDescription": "Spaces inside link text",
|
||||
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md039",
|
||||
"ruleNames": [
|
||||
"MD039",
|
||||
"no-space-in-links"
|
||||
]
|
||||
},
|
||||
{
|
||||
"errorContext": "[ link `link` ]",
|
||||
"errorDetail": null,
|
||||
"errorRange": [
|
||||
1,
|
||||
15
|
||||
],
|
||||
"fixInfo": {
|
||||
"deleteCount": 13,
|
||||
"editColumn": 2,
|
||||
"insertText": "link `link`"
|
||||
},
|
||||
"lineNumber": 15,
|
||||
"ruleDescription": "Spaces inside link text",
|
||||
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md039",
|
||||
"ruleNames": [
|
||||
"MD039",
|
||||
"no-space-in-links"
|
||||
]
|
||||
},
|
||||
{
|
||||
"errorContext": "[ *link* link ]",
|
||||
"errorDetail": null,
|
||||
"errorRange": [
|
||||
1,
|
||||
15
|
||||
],
|
||||
"fixInfo": {
|
||||
"deleteCount": 13,
|
||||
"editColumn": 2,
|
||||
"insertText": "*link* link"
|
||||
},
|
||||
"lineNumber": 17,
|
||||
"ruleDescription": "Spaces inside link text",
|
||||
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md039",
|
||||
"ruleNames": [
|
||||
"MD039",
|
||||
"no-space-in-links"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
[*foo*](https://bar/)
|
||||
|
||||
[**foo**](https://bar/)
|
||||
[__foo__](https://bar/)
|
||||
|
||||
[foo "bar"](https://baz/)
|
||||
|
||||
|
|
@ -28,6 +28,8 @@
|
|||
|
||||
[ *foo* ](https://bar/) {MD039}
|
||||
|
||||
[ __foo__ ](https://bar/) {MD039}
|
||||
|
||||
The following shouldn't break anything:
|
||||
[](/images/Screenshot.png)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue