mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 14:00:13 +01:00
Promote applyFix and applyFixes helpers into core library.
This commit is contained in:
parent
e0219411c6
commit
4e30462216
13 changed files with 898 additions and 823 deletions
|
|
@ -166,6 +166,36 @@ markdownlint(options, assertLintResultsCallback);
|
|||
assertLintResultsCallback(null, await markdownlint.promises.markdownlint(options));
|
||||
})();
|
||||
|
||||
assert.equal(
|
||||
markdownlint.applyFix(
|
||||
"# Fixing\n",
|
||||
{
|
||||
"insertText": "Head",
|
||||
"editColumn": 3,
|
||||
"deleteCount": 3
|
||||
},
|
||||
"\n"
|
||||
),
|
||||
"# Heading\n"
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
markdownlint.applyFixes(
|
||||
"# Fixing\n",
|
||||
[
|
||||
{
|
||||
"lineNumber": 1,
|
||||
"fixInfo": {
|
||||
"insertText": "Head",
|
||||
"editColumn": 3,
|
||||
"deleteCount": 3
|
||||
}
|
||||
}
|
||||
]
|
||||
),
|
||||
"# Heading\n"
|
||||
);
|
||||
|
||||
const configuration: markdownlint.Configuration = {
|
||||
"custom-rule": true,
|
||||
"no-hard-tabs": false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue