-
-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Initial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and discussions and couldn’t find anything (or linked relevant results below)
Affected package
Steps to reproduce
import {retext} from 'retext'
import retextSmartypants from 'retext-smartypants'
const file = await retext()
.use(retextSmartypants)
.process('...."')
console.log(String(file))
Actual behavior
All 4 dots are converted to a single ellipsis.
Expected behavior
3 dots should be sufficient to form an ellipsis. Additional dots should not be merged into the same ellipsis.
The use case is when we use ellipsis at the end of a sentence and need a period right after it. Currently there's no way to express it with retext-smartypants.
This punctuation style is defined here:
- https://www.iup.edu/writingcenter/writing-resources/punctuation/using-ellipses.html#:~:text=Using%20an%20ellipsis%20to%20omit%20words%20from%20the%20end%20of%20a%20sentence:&text=Notice%20that%20when%20using%20an,a%20period%20after%20the%20citation.
- https://www.thepunctuationguide.com/ellipses.html
- and discussed informally in a writing community: https://www.reddit.com/r/writing/comments/z744l7/do_you_use_a_period_after_ellipsis/
The same issue has been opened before in #9 but that issue contained other problems and was closed with only the other problems resolved.
I can help implement it if no one else wants to, but I'm not sure how we want to go about supporting this. Here are some ways I thought of:
- change the behaviour of
'spaced'
,'unspaced'
, andtrue
to only convert 3 dots a time. This would be a breaking change to anyone currently using more than 3 dots for ellipsis, but idk if anyone does that - add a
'3dots'
option toellipses
. This would guarantee backwards compatibility but make the config harder to maintain, becuase it's not exclusive with the'spaced'
and'unspaced'
options, so we would likely need a'3dots-spaced'
and'3dots-unspaced'
, which would get doubled again when there's another non-exclusive option in the future - change the type of
ellipses
to an object withspace
and3dots
each being a boolean field. This would be a breaking change but we can overload the option to continue supportingstrings | null | undefined
- Add a new boolean field like
ellipsis-3dots
and keep the current one. Backwards compatible but would probably make the API too complex
I'm thinking 1 or 3. 1 if the assumption that nobody uses more than 3 dots for ellipses is reasonable or if we are fine with a small breaking change for those users. 3 otherwise.
The name 3dots
might not be the best too
Runtime
No response
Package manager
No response
Operating system
No response
Build and bundle tools
No response