Skip to content

Commit

Permalink
test(#194): add test for links in angle brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
grantlemons committed Jan 13, 2025
1 parent 809cacd commit bed819c
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions harper-core/src/parsers/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,24 @@ mod tests {
}

#[test]
fn respects_config() {
let source = r#"[elijah-potter/harper](https://github.com/elijah-potter/harper)"#;
fn issue_194() {
let source = r"<http://localhost:9093>";
let parser = Markdown::new(MarkdownOptions {
ignore_link_title: true,
..MarkdownOptions::default()
});
let token_kinds = parser
.parse_str(source)
.iter()
.map(|t| t.kind)
.collect::<Vec<_>>();

assert!(matches!(token_kinds.as_slice(), &[TokenKind::Unlintable]));
}

#[test]
fn respects_link_title_config() {
let source = r"[elijah-potter/harper](https://github.com/elijah-potter/harper)";
let parser = Markdown::new(MarkdownOptions {
ignore_link_title: true,
..MarkdownOptions::default()
Expand Down

0 comments on commit bed819c

Please sign in to comment.