Skip to content

Commit 14b0880

Browse files
authored
Properly tokenize quotes inside strings. Fixes #319 (#321)
* Properly tokenize quotes inside strings This closes #319 * Fulfill black * Add docs
1 parent 079748d commit 14b0880

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

docs/changelog.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
:orphan:
22

3+
Master
4+
======
5+
- ext.commands
6+
- Bug fixes
7+
- Make sure double-quotes are properly tokenized for bot commands
8+
39
2.4.0
410
======
511
- TwitchIO

twitchio/ext/commands/stringparser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def process_string(self, msg: str) -> Dict[int, str]:
5454
self.index += 1
5555
self.start = self.count + 1
5656

57-
elif loc == '"':
57+
elif loc == '"' and self.start == self.count: # only tokenize if they're a new word
5858
if not self.ignore:
5959
self.start = self.count + 1
6060
self.ignore = True

0 commit comments

Comments
 (0)