Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Detect sentence ending with "etc." #50

Open
mschoettle opened this issue Apr 25, 2024 · 2 comments
Open

[Bug] Detect sentence ending with "etc." #50

mschoettle opened this issue Apr 25, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@mschoettle
Copy link

Describe the bug

When there is a sentence ending in "etc." followed by another sentence it is not detected.

Markdownlint input

This is a sentence, foo, bar etc. This is a second sentence.

Expected behavior

It would be nice if the max-one-sentence-per-line would be detected for this case.

Additional context

n/a

@mschoettle mschoettle added the bug Something isn't working label Apr 25, 2024
@aepfli
Copy link
Owner

aepfli commented Apr 25, 2024

This is a challenging problem, and my solution is far from ideal, especially for this detection.

First, etc. can be in a sentence's middle or the end.
If it is in the middle of a sentence, we can't rely on capitalization to detect if this marks a new sentence or just another capitalized word.

We're not detecting sentences; we just try to detect patterns at the end of a sentence.
Currently, etc. is on the list of words to be ignored.
The question is whether it would be better just to have two lines with an etc., rather than ignoring it.

Anyway, I am having a hard time with this bug. I'll try to challenge this with somebody, but it seems like we hit a roadblock with the possibilities available for this kind of approach.

@mschoettle
Copy link
Author

Thanks for looking into it. I suspected that it is tricky.

I was thinking about converting "etc." to "et cetera" internally to do the check. However, I think that still would not work for all cases since someone might wriite just "etc" and then there is still the potential of it showing up in the middle or the end of a sentence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants