mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-23 20:28:06 +01:00
[Glitch] Fix the hashtag judgment of the compose form to be the same as the server side
Port cd94854e7d
to glitch-soc
Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
parent
23cd5f2c15
commit
1d8e930445
1 changed files with 16 additions and 1 deletions
|
@ -6,7 +6,22 @@ import { FormattedMessage } from 'react-intl';
|
|||
import { me } from 'flavours/glitch/util/initial_state';
|
||||
import { profileLink, termsLink } from 'flavours/glitch/util/backend_links';
|
||||
|
||||
const APPROX_HASHTAG_RE = /(?:^|[^\/\)\w])#(\w*[a-zA-Z·]\w*)/i;
|
||||
const HASHTAG_SEPARATORS = "_\\u00b7\\u200c";
|
||||
const ALPHA = '\\p{L}\\p{M}';
|
||||
const WORD = '\\p{L}\\p{M}\\p{N}\\p{Pc}';
|
||||
const APPROX_HASHTAG_RE = new RegExp(
|
||||
'(?:^|[^\\/\\)\\w])#((' +
|
||||
'[' + WORD + '_]' +
|
||||
'[' + WORD + HASHTAG_SEPARATORS + ']*' +
|
||||
'[' + ALPHA + HASHTAG_SEPARATORS + ']' +
|
||||
'[' + WORD + HASHTAG_SEPARATORS +']*' +
|
||||
'[' + WORD + '_]' +
|
||||
')|(' +
|
||||
'[' + WORD + '_]*' +
|
||||
'[' + ALPHA + ']' +
|
||||
'[' + WORD + '_]*' +
|
||||
'))', 'iu'
|
||||
);
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
needsLockWarning: state.getIn(['compose', 'privacy']) === 'private' && !state.getIn(['accounts', me, 'locked']),
|
||||
|
|
Loading…
Reference in a new issue