Skip to content
Snippets Groups Projects
Commit 5a7590d9 authored by Eugen's avatar Eugen Committed by GitHub
Browse files

Merge pull request #655 from marrus-sh/mastodon-frontend-character-count

Fixes #263; makes JavaScript's character counting the same as Ruby's
parents af5cb0f8 4d2af0d6
No related branches found
No related tags found
No related merge requests found
......@@ -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' }}>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment