소스 검색

match hashtag regex in js client with server (#6431)

the slight mismatch in hashtag regex between js and ruby was causing
hashtag warning to be displayed for unlisted tweets when an invalid
hashtag was entered

exact version of ruby regex not possible in js as POSIX bracket
expressions are not supported, this version approximates and doesn't
give same unicode support
master
Daniel King 6 년 전
committed by Eugen Rochko
부모
커밋
95c8232109
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. +1
    -1
      app/javascript/mastodon/features/compose/containers/warning_container.js

+ 1
- 1
app/javascript/mastodon/features/compose/containers/warning_container.js 파일 보기

@@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { me } from '../../../initial_state';

const APPROX_HASHTAG_RE = /(?:^|[^\/\)\w])#(\S+)/i;
const APPROX_HASHTAG_RE = /(?:^|[^\/\)\w])#(\w*[a-zA-Z]\w*)/i;

const mapStateToProps = state => ({
needsLockWarning: state.getIn(['compose', 'privacy']) === 'private' && !state.getIn(['accounts', me, 'locked']),


불러오는 중...
취소
저장