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

Fixes #263; makes JavaScript's character counting the same as Ruby's
master
Eugen 8 years ago committed by GitHub
commit 5a7590d94c
  1. 2
      app/assets/javascripts/components/features/compose/components/character_counter.jsx

@ -10,7 +10,7 @@ const CharacterCounter = React.createClass({
mixins: [PureRenderMixin], mixins: [PureRenderMixin],
render () { 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 ( return (
<span style={{ fontSize: '16px', cursor: 'default' }}> <span style={{ fontSize: '16px', cursor: 'default' }}>

Loading…
Cancel
Save