Skip to content

fix: allow lowercase mp3 after an - #3369

Merged
elijah-potter merged 2 commits into
Automattic:masterfrom
cfcryptotrader-rgb:fix-an-mp3-article
Jun 29, 2026
Merged

fix: allow lowercase mp3 after an#3369
elijah-potter merged 2 commits into
Automattic:masterfrom
cfcryptotrader-rgb:fix-an-mp3-article

Conversation

@cfcryptotrader-rgb

Copy link
Copy Markdown
Contributor

Summary

  • Treat lowercase mp followed by a digit (for example, mp3) as beginning with the vowel sound "em" for indefinite-article linting.
  • Add regression coverage for both an mp3 and a mp3.

Fixes #3289.

Verification

  • cargo test -p harper-core linting::an_a -- --nocapture
  • git diff --check

@hippietrail hippietrail left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but add a comment please.


if matches!(word, ['m', 'p', digit, ..] if digit.is_ascii_digit()) {
return Some(InitialSound::Vowel);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine for now as uppercase MP3 is already handled in the acronyms section and mp-3 and mp 3 are way less common that mp3. We can extend this if we find other "lowercase initialisms".

I think it's different enough from the other match arms here to warrant a comment though.

@hippietrail hippietrail left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now. Thanks.

@elijah-potter
elijah-potter added this pull request to the merge queue May 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks May 27, 2026
@hippietrail

Copy link
Copy Markdown
Collaborator

See also: #3531

@elijah-potter
elijah-potter added this pull request to the merge queue Jun 29, 2026
Merged via the queue into Automattic:master with commit ef2b49d Jun 29, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive: "an mp3" wrongly flagged to change to "a mp3"

3 participants