diff options
| author | Satsuki Yanagi <17376330+u1-liquid@users.noreply.github.com> | 2019-05-05 09:27:55 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-05-05 09:27:55 +0900 |
| commit | 5fb0a995dd2d9cf65ed93fca78502f42a7c3e22d (patch) | |
| tree | ba41be9daaf91435ff4429667a6bbcbe094a39c5 /src/mfm | |
| parent | ログアウトの処理と外部サービス連携Viewがセッションク... (diff) | |
| download | misskey-5fb0a995dd2d9cf65ed93fca78502f42a7c3e22d.tar.gz misskey-5fb0a995dd2d9cf65ed93fca78502f42a7c3e22d.tar.bz2 misskey-5fb0a995dd2d9cf65ed93fca78502f42a7c3e22d.zip | |
様々な修正 (#4859)
Typo, Redundant code, Syntax error の修正
Diffstat (limited to 'src/mfm')
| -rw-r--r-- | src/mfm/language.ts | 4 | ||||
| -rw-r--r-- | src/mfm/prelude.ts | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/mfm/language.ts b/src/mfm/language.ts index 207400d6d6..003ae348a4 100644 --- a/src/mfm/language.ts +++ b/src/mfm/language.ts @@ -129,7 +129,7 @@ export const mfmLanguage = P.createLanguage({ mention: () => { return P((input, i) => { const text = input.substr(i); - const match = text.match(/^@\w([\w-]*\w)?(?:@[\w\.\-]+\w)?/); + const match = text.match(/^@\w([\w-]*\w)?(?:@[\w.\-]+\w)?/); if (!match) return P.makeFailure(i, 'not a mention'); if (input[i - 1] != null && input[i - 1].match(/[a-z0-9]/i)) return P.makeFailure(i, 'not a mention'); return P.makeSuccess(i + match[0].length, match[0]); @@ -141,7 +141,7 @@ export const mfmLanguage = P.createLanguage({ }, hashtag: () => P((input, i) => { const text = input.substr(i); - const match = text.match(/^#([^\s\.,!\?'"#:\/\[\]【】]+)/i); + const match = text.match(/^#([^\s.,!?'"#:\/\[\]【】]+)/i); if (!match) return P.makeFailure(i, 'not a hashtag'); let hashtag = match[1]; hashtag = removeOrphanedBrackets(hashtag); diff --git a/src/mfm/prelude.ts b/src/mfm/prelude.ts index 7584389184..e18625bc7d 100644 --- a/src/mfm/prelude.ts +++ b/src/mfm/prelude.ts @@ -36,4 +36,4 @@ export function createTree(type: string, children: MfmForest, props: any): MfmTr return T.createTree({ type, props }, children); } -export const urlRegex = /^https?:\/\/[\w\/:%#@\$&\?!\(\)\[\]~\.,=\+\-]+/; +export const urlRegex = /^https?:\/\/[\w\/:%#@$&?!()\[\]~.,=+\-]+/; |