You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
search-replace Custom rule [This rule threw an exception: Property 'range' of onError parameter is incorrect.]
what's interesting is that the rule actually seems to work, it's just a problem with the output. this rule is meant to catch linebreaks within a sentence. e.g.
The following line
break should not exist.
The text was updated successfully, but these errors were encountered:
@ctcpip From a plugin, we can't report error to markdownlint which spans multiple lines. The error range can't cross line ending.
As a workaround, when the plugin finds a multi line match it is split on \n and a separate error is reported for each line. So the match needs to have at least one character on both sides of \n. With following custom rule definition you can achieve what you want:
{
"name": "no-hardwraps",
"message": "Do not use hard wraps",
"searchPattern": "/[\\w\\d ]\\n[\\w\\d]/gm",
"searchScope": "text"
}
Note: Due to the limitation this will only report errors and will not be able to perform auto fixes.
searchPattern: "/(?<=[\\w\\d ])\\n(?=[\\w\\d])/g"
results in:
search-replace Custom rule [This rule threw an exception: Property 'range' of onError parameter is incorrect.]
what's interesting is that the rule actually seems to work, it's just a problem with the output. this rule is meant to catch linebreaks within a sentence. e.g.
The text was updated successfully, but these errors were encountered: