diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-10-31 22:38:05 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-10-31 22:38:05 +0900 |
| commit | 04aff8866ec598cee66f3e5e2c16406f283546a3 (patch) | |
| tree | 867b63cc921750677bc1ed7a3a2fa57b1995d4ae /src/mfm/parse/elements | |
| parent | Refactor (diff) | |
| download | misskey-04aff8866ec598cee66f3e5e2c16406f283546a3.tar.gz misskey-04aff8866ec598cee66f3e5e2c16406f283546a3.tar.bz2 misskey-04aff8866ec598cee66f3e5e2c16406f283546a3.zip | |
[MFM] Better hashtag detection
Diffstat (limited to 'src/mfm/parse/elements')
| -rw-r--r-- | src/mfm/parse/elements/hashtag.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mfm/parse/elements/hashtag.ts b/src/mfm/parse/elements/hashtag.ts index e4e9df6ce3..b5c8ae5ac7 100644 --- a/src/mfm/parse/elements/hashtag.ts +++ b/src/mfm/parse/elements/hashtag.ts @@ -9,9 +9,9 @@ export type TextElementHashtag = { }; export default function(text: string, i: number) { - if (!(/^\s#[^\s\.,!\?]+/.test(text) || (i == 0 && /^#[^\s\.,!\?]+/.test(text)))) return null; + if (!(/^\s#[^\s\.,!\?#]+/.test(text) || (i == 0 && /^#[^\s\.,!\?#]+/.test(text)))) return null; const isHead = text.startsWith('#'); - const hashtag = text.match(/^\s?#[^\s\.,!\?]+/)[0]; + const hashtag = text.match(/^\s?#[^\s\.,!\?#]+/)[0]; const res: any[] = !isHead ? [{ type: 'text', content: text[0] |