diff options
author | Surinna Curtis <ekiru.0@gmail.com> | 2017-06-26 09:33:35 -0500 |
---|---|---|
committer | Surinna Curtis <ekiru.0@gmail.com> | 2017-06-26 09:34:31 -0500 |
commit | 7b53d4bbca613441ddb18a561211319223ce516f (patch) | |
tree | e66b6a26b5dd41f2451c2c8d7f535bc7f7fc8d90 /app/javascript/packs | |
parent | 4f36aad6e8e1dad6b9907b62a200919fbe0d4ebe (diff) |
Bio length on client side mostly doesn't count metadata
Diffstat (limited to 'app/javascript/packs')
-rw-r--r-- | app/javascript/packs/public.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/javascript/packs/public.js b/app/javascript/packs/public.js index 150a60670..ae903cdd3 100644 --- a/app/javascript/packs/public.js +++ b/app/javascript/packs/public.js @@ -4,6 +4,7 @@ import { delegate } from 'rails-ujs'; import emojify from '../mastodon/emoji'; import { getLocale } from '../mastodon/locales'; import loadPolyfills from '../mastodon/load_polyfills'; +import { processBio } from '../mastodon/features/account/util/bio_metadata'; require.context('../images/', true); @@ -87,7 +88,8 @@ function main() { delegate(document, '.account_note', 'input', ({ target }) => { const noteCounter = document.querySelector('.note-counter'); if (noteCounter) { - noteCounter.textContent = 500 - length(target.value); + const noteWithoutMetadata = processBio(target.value).text; + noteCounter.textContent = 500 - length(noteWithoutMetadata); } }); } |