-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from santa112358/enable_full_width_space
enable hashtag detection right before the full width space
- Loading branch information
Showing
3 changed files
with
25 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
const _Symbols = '·・ー_'; | ||
const _symbols = '·・ー_'; | ||
|
||
const _Numbers = '0-90-9'; | ||
const _numbers = '0-90-9'; | ||
|
||
const _EnglishLetters = 'a-zA-Za-zA-Z'; | ||
const _englishLetters = 'a-zA-Za-zA-Z'; | ||
|
||
const _JapaneseLetters = 'ぁ-んァ-ン一-龠'; | ||
const _japaneseLetters = 'ぁ-んァ-ン一-龠'; | ||
|
||
const _KoreanLetters = '\u1100-\u11FF\uAC00-\uD7A3'; | ||
const _koreanLetters = '\u1100-\u11FF\uAC00-\uD7A3'; | ||
|
||
const _SpanishLetters = 'áàãâéêíóôõúüçÁÀÃÂÉÊÍÓÔÕÚÜÇ'; | ||
const _spanishLetters = 'áàãâéêíóôõúüçÁÀÃÂÉÊÍÓÔÕÚÜÇ'; | ||
|
||
const _ArabicLetters = '\u0621-\u064A'; | ||
const _arabicLetters = '\u0621-\u064A'; | ||
|
||
const _ThaiLetters = '\u0E00-\u0E7F'; | ||
const _thaiLetters = '\u0E00-\u0E7F'; | ||
|
||
const _HashTagContentLetters = _Symbols + | ||
_Numbers + | ||
_EnglishLetters + | ||
_JapaneseLetters + | ||
_KoreanLetters + | ||
_SpanishLetters + | ||
_ArabicLetters + | ||
_ThaiLetters; | ||
const hashTagContentLetters = _symbols + | ||
_numbers + | ||
_englishLetters + | ||
_japaneseLetters + | ||
_koreanLetters + | ||
_spanishLetters + | ||
_arabicLetters + | ||
_thaiLetters; | ||
|
||
/// Regular expression to extract hashtag from text | ||
/// | ||
/// Supports English, Japanese, Korean, Spanish, Arabic, and Thai | ||
final hashTagRegExp = RegExp( | ||
"(?!\\n)(?:^|\\s)(#([$_HashTagContentLetters]+))", | ||
"(?!\\n)(?:^|\\s)(#([$hashTagContentLetters]+))", | ||
multiLine: true, | ||
); | ||
|
||
/// Regular expression when you select decorateAtSign | ||
final hashTagAtSignRegExp = RegExp( | ||
"(?!\\n)(?:^|\\s)([#@]([$_HashTagContentLetters]+))", | ||
"(?!\\n)(?:^|\\s)([#@]([$hashTagContentLetters]+))", | ||
multiLine: true, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters