about summary refs log tree commit diff
path: root/app/assets/javascripts/components
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/components')
-rw-r--r--app/assets/javascripts/components/features/compose/components/character_counter.jsx3
1 files changed, 2 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 31d82d4d2..284c51b6d 100644
--- a/app/assets/javascripts/components/features/compose/components/character_counter.jsx
+++ b/app/assets/javascripts/components/features/compose/components/character_counter.jsx
@@ -1,4 +1,5 @@
 import PropTypes from 'prop-types';
+import { length } from 'stringz';
 
 class CharacterCounter extends React.PureComponent {
 
@@ -10,7 +11,7 @@ class CharacterCounter extends React.PureComponent {
   }
 
   render () {
-    const diff = this.props.max - this.props.text.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "_").length;
+    const diff = this.props.max - length(this.props.text);
 
     return this.checkRemainingText(diff);
   }