diff options
author | Eugen <eugen@zeonfederated.com> | 2017-02-27 15:51:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-27 15:51:57 +0100 |
commit | 5a7590d94c9549408fbbdf69ea0e1c68a150b604 (patch) | |
tree | 8c1a5ffe1640cd29d7e35100e7a4322313f9e6a4 /app/assets | |
parent | af5cb0f853d523fe577da83c54040a05151ac90d (diff) | |
parent | 4d2af0d664b155f5ca2e9259920ed70eec63b8b0 (diff) |
Merge pull request #655 from marrus-sh/mastodon-frontend-character-count
Fixes #263; makes JavaScript's character counting the same as Ruby's
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/components/features/compose/components/character_counter.jsx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/assets/javascripts/components/features/compose/components/character_counter.jsx b/app/assets/javascripts/components/features/compose/components/character_counter.jsx index f0c1b7c8d..e6b675354 100644 --- a/app/assets/javascripts/components/features/compose/components/character_counter.jsx +++ b/app/assets/javascripts/components/features/compose/components/character_counter.jsx @@ -10,7 +10,7 @@ const CharacterCounter = React.createClass({ mixins: [PureRenderMixin], render () { - const diff = this.props.max - this.props.text.length; + const diff = this.props.max - this.props.text.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "_").length; return ( <span style={{ fontSize: '16px', cursor: 'default' }}> |