Skip to content
Merged
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: 2 additions & 0 deletions src/config/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ pub static RULE_ALIAS_MAP: phf::Map<&'static str, &'static str> = phf::phf_map!
"MD072" => "MD072",
"MD073" => "MD073",
"MD074" => "MD074",
"MD075" => "MD075",

// Aliases (hyphen format)
"HEADING-INCREMENT" => "MD001",
Expand Down Expand Up @@ -301,6 +302,7 @@ pub static RULE_ALIAS_MAP: phf::Map<&'static str, &'static str> = phf::phf_map!
"FRONTMATTER-KEY-SORT" => "MD072",
"TOC-VALIDATION" => "MD073",
"MKDOCS-NAV" => "MD074",
"ORPHANED-TABLE-ROWS" => "MD075",
};

/// Resolve a rule name alias to its canonical form with O(1) perfect hash lookup
Expand Down
6 changes: 3 additions & 3 deletions src/rules/md054_link_image_style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl MD054LinkImageStyle {
"full" => self.config.full,
"inline" => self.config.inline,
"shortcut" => self.config.shortcut,
"url_inline" => self.config.url_inline,
"url-inline" => self.config.url_inline,
_ => false,
}
}
Expand Down Expand Up @@ -205,7 +205,7 @@ impl Rule for MD054LinkImageStyle {
let text = cap.get(1).unwrap().as_str();
let url = cap.get(2).unwrap().as_str();
all_matches.push(LinkMatch {
style: if text == url { "url_inline" } else { "inline" },
style: if text == url { "url-inline" } else { "inline" },
start: m.start(),
end: m.end(),
});
Expand Down Expand Up @@ -402,7 +402,7 @@ mod tests {
let result = rule.check(&ctx).unwrap();

assert_eq!(result.len(), 1);
assert!(result[0].message.contains("'url_inline'"));
assert!(result[0].message.contains("'url-inline'"));
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion tests/rules/md054_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ This is a [https://example.com](https://example.com) URL-inline link.
let result = rule.check(&ctx).unwrap();
assert_eq!(result.len(), 1);
assert_eq!(result[0].line, 2);
assert_eq!(result[0].message, "Link/image style 'url_inline' is not allowed");
assert_eq!(result[0].message, "Link/image style 'url-inline' is not allowed");
}

#[test]
Expand Down
4 changes: 2 additions & 2 deletions tests/rules_mod_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ fn test_all_rules_returns_all_rules() {
let config = Config::default();
let rules = all_rules(&config);

// Should return all 68 rules as defined in the RULES array (MD001-MD074)
assert_eq!(rules.len(), 68);
// Should return all 69 rules as defined in the RULES array (MD001-MD075)
assert_eq!(rules.len(), 69);

// Verify some specific rules are present
let rule_names: HashSet<String> = rules.iter().map(|r| r.name().to_string()).collect();
Expand Down