-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Autopunctuation improvements: Now with correctly-handled chat markdow…
…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
- Loading branch information
1 parent
a860ef5
commit fcc5947
Showing
2 changed files
with
6 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
//Any EOL char that isn't appropriate punctuation | ||
GLOBAL_DATUM_INIT(has_no_eol_punctuation, /regex, regex(@"\w$")) | ||
//Does the line end in any EOL char that isn't appropriate punctuation OR does it end in a chat-formatted markdown sequence (+bold+, etc) without a period? | ||
GLOBAL_DATUM_INIT(needs_eol_autopunctuation, /regex, regex(@"([a-zA-Z\d]|[^.?!~-][+|_])$")) | ||
|
||
//All non-capitalized 'i' surrounded with whitespace (aka, 'hello >i< am a cat') | ||
GLOBAL_DATUM_INIT(noncapital_i, /regex, regex(@"\b[i]\b", "g")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters