Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(ci): fix URL RXs in linters #38540

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .markdownlint.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
{
"name": "un-closed-md-link",
"message": "Missing closing bracket ')'",
"searchPattern": "/(\\[[^\\]]*?\\]\\(([^\\)\\n]|\\([^\\)\\n]\\)|\\s[\"'])+?)(\\n|\\s|[,:][\\s\\n])/gm",
"searchPattern": "/\\[.*?\\]\\([^ )\\n\",:]+(?:[\\n\",:]| [^\"']| [\"'].+?[\"'][^)])/gm",
"searchScope": "text",
},
{
Expand Down
6 changes: 4 additions & 2 deletions scripts/log-url-issues.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,13 @@ for await (const filePath of walkSync(rootDir)) {

// check broken URL fragment
for (const fragment of deletedFragmentDetails) {
const locations = getLocations(content, fragment);
const locations = getLocations(content, `${fragment}(?: "|\\))`);
// check fragments in the same file
const urlParts = fragment.split("#");
if (filePath.includes(`${urlParts[0]}/index.md`)) {
locations.push(...getLocations(content, `[(]#${urlParts[1]}`));
locations.push(
...getLocations(content, `\\(#${urlParts[1]}(?: "|\\))`),
);
}
if (locations.length) {
isAllOk = false;
Expand Down
Loading