[MIRROR] Autopunctuation improvements: Now with correctly-handled chat markdown! #1533
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Original PR: NovaSector/NovaSector#378
About The Pull Request
felinid in Discord reported that ending sentences in an underscore caused autopunctuation to apply periods. For reasons unknown to science,
\w
is aliased to[a-zA-Z0-9_]
which as you can see, carries an underscore in its matching list. This change replicates\w
without this match.I also bit the bullet and added in a check to test for whether a sentence has formatting markdown at the end of it WITHOUT being preceded by some kind of sentence-terminator character. This means you can now quickfire things like
+WHAT+
and the game will correctly add periods for you, but if you supply your own markers like+WHAT!+
, it will leave those alone.How This Contributes To The Nova Sector Roleplay Experience
Better autopunctuation for everybody!
Proof of Testing
Screenshots/Videos
dreamseeker_ZU633fq8us.mp4
Before:
After:
Markdown changes:
dreamseeker_X3woO8IOob.mp4
Changelog
🆑 yooriss
fix: Autopunctuation no longer checks for underscores at the end of messages.
fix: Autopunctuation now correctly inserts EOL periods for any bolded/italicised/underline messages without them, if they don't already have punctuation of their own (like exclamation marks, tildes, question marks, or hyphens).
/:cl: