mirror of
https://github.com/theoludwig/markdownlint-rule-relative-links.git
synced 2026-02-20 03:09:05 +01:00
refactor: early conditions first
This commit is contained in:
@@ -119,7 +119,7 @@ const getMarkdownIdOrAnchorNameFragments = (content) => {
|
||||
}
|
||||
|
||||
const anchorIdOrName = anchorMatch[1]
|
||||
if (anchorIdOrName === undefined) {
|
||||
if (anchorIdOrName.length <= 0) {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -136,5 +136,5 @@ module.exports = {
|
||||
filterTokens,
|
||||
convertHeadingToHTMLFragment,
|
||||
getMarkdownHeadings,
|
||||
getMarkdownAnchorHTMLFragments: getMarkdownIdOrAnchorNameFragments,
|
||||
getMarkdownIdOrAnchorNameFragments,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user