Skip to content

Commit

Permalink
fix: Markdown parser screwing with ellipsis
Browse files Browse the repository at this point in the history
  • Loading branch information
elijah-potter committed Sep 25, 2024
1 parent d48dd1d commit 3d3d7c3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
9 changes: 9 additions & 0 deletions harper-core/src/linting/sentence_capitalization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,13 @@ mod tests {
1
)
}

#[test]
fn unphased_ellipsis() {
assert_lint_count(
"the linter should not be affected by... that ellipsis.",
SentenceCapitalization,
1
)
}
}
7 changes: 5 additions & 2 deletions harper-core/src/parsers/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,11 @@ impl Parser for Markdown {
let mut english_parser = PlainEnglish;

let source_str: String = source.iter().collect();
let md_parser =
pulldown_cmark::Parser::new_ext(&source_str, pulldown_cmark::Options::all());
let md_parser = pulldown_cmark::Parser::new_ext(
&source_str,
pulldown_cmark::Options::all()
.difference(pulldown_cmark::Options::ENABLE_SMART_PUNCTUATION)
);

let mut tokens = Vec::new();

Expand Down

0 comments on commit 3d3d7c3

Please sign in to comment.