mirror of
git://jb55.com/damus
synced 2024-09-18 19:23:49 +00:00
Always stop at first whitespace
This commit is contained in:
parent
f69e0c660a
commit
bb9fc6f905
@ -55,8 +55,8 @@ static int consume_until_whitespace(struct cursor *cur, int or_end) {
|
||||
while (cur->p < cur->end) {
|
||||
c = *cur->p;
|
||||
|
||||
if (is_whitespace(c) && consumedAtLeastOne)
|
||||
return 1;
|
||||
if (is_whitespace(c))
|
||||
return consumedAtLeastOne;
|
||||
|
||||
cur->p++;
|
||||
consumedAtLeastOne = true;
|
||||
|
@ -141,7 +141,7 @@ class damusTests: XCTestCase {
|
||||
}
|
||||
|
||||
func testNoParseUrlWithOnlyWhitespace() {
|
||||
let testString = "https:// "
|
||||
let testString = "https:// "
|
||||
let parsed = parse_mentions(content: testString, tags: [])
|
||||
|
||||
XCTAssertNotNil(parsed)
|
||||
|
Loading…
Reference in New Issue
Block a user