Skip to content

Commit

Permalink
Merge pull request #655 from marrus-sh/mastodon-frontend-character-count
Browse files Browse the repository at this point in the history
Fixes #263; makes JavaScript's character counting the same as Ruby's
  • Loading branch information
Gargron committed Feb 27, 2017
2 parents af5cb0f + 4d2af0d commit 5a7590d
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -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' }}>
Expand Down

0 comments on commit 5a7590d

Please sign in to comment.