Fix parse mention without space in content

Changelog-Fixed: Fix parse mention without space in content
Closes: #936
Fixes: #992
This commit is contained in:
Joshua Jiang
2023-04-15 02:40:56 -07:00
committed by William Casarin
parent fc3a86027f
commit c439100a86
3 changed files with 77 additions and 1 deletions

View File

@@ -209,7 +209,7 @@ int damus_parse_content(struct blocks *blocks, const char *content) {
c = peek_char(&cur, 0);
pre_mention = cur.p;
if (cp == -1 || is_whitespace(cp)) {
if (cp == -1 || is_whitespace(cp) || c == '#') {
if (c == '#' && (parse_mention_index(&cur, &block) || parse_hashtag(&cur, &block))) {
if (!add_text_then_block(&cur, blocks, block, &start, pre_mention))
return 0;