diff --git a/damus-c/cursor.h b/damus-c/cursor.h index bb3cc30f..77e54144 100644 --- a/damus-c/cursor.h +++ b/damus-c/cursor.h @@ -485,11 +485,11 @@ static inline int parse_str(struct cursor *cur, const char *str) { return 1; } -static inline int is_whitespace(char c) { +static inline int is_whitespace(int c) { return c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r'; } -static inline int is_underscore(char c) { +static inline int is_underscore(int c) { return c == '_'; } diff --git a/damusTests/HashtagTests.swift b/damusTests/HashtagTests.swift index 5297340a..ce857614 100644 --- a/damusTests/HashtagTests.swift +++ b/damusTests/HashtagTests.swift @@ -545,4 +545,15 @@ final class HashtagTests: XCTestCase { XCTAssertEqual(parsed[2].asText, " is allowed in hashtags") } + // Japanese: bai (倍) (U+500D) (allowed in hashtags) + func testHashtagWithBaiKanji() { + let parsed = parse_note_content(content: .content("pow! #10倍界王拳 is allowed in hashtags",nil)).blocks + + XCTAssertNotNil(parsed) + XCTAssertEqual(parsed.count, 3) + XCTAssertEqual(parsed[0].asText, "pow! ") + XCTAssertEqual(parsed[1].asHashtag, "10倍界王拳") + XCTAssertEqual(parsed[2].asText, " is allowed in hashtags") + } + }