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

[MIRROR] Autopunctuation improvements: Now with correctly-handled chat markdown! #1533

Merged
merged 1 commit into from
Jan 14, 2024

Conversation

Steals-The-PRs
Copy link
Collaborator

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:

image

After:

dreamseeker_W1DjKuI3mw

Markdown changes:

dreamseeker_X3woO8IOob.mp4

YrI9nCdY3K

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:

…n! (#378)

* Autopunctuation regex fix

* Add unflavored markdown EOL checking to autopunctuation

* Combine has_no_eol_punctuation and ends_in_unflavored_markdown for less findtext() calls

* Remove unused autopunctuation regex globals and simplify pattern
@Iajret Iajret merged commit 41939f1 into master Jan 14, 2024
23 checks passed
@Iajret Iajret deleted the upstream-mirror-378 branch January 14, 2024 09:34
AnywayFarus added a commit that referenced this pull request Jan 14, 2024
Iajret pushed a commit that referenced this pull request Mar 19, 2024
ReezeBL pushed a commit that referenced this pull request Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants