#20738 closed enhancement (duplicate)
Improve Javascript Word Counting for TinyMCE
Reported by: | westi | Owned by: | chriscct7 |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.4 |
Component: | I18N | Keywords: | close |
Focuses: | Cc: |
Description
This is a follow on from #8759 to further improve the code.
While we improved it in 3.4 we can do a better job to more fully support the customisation for all different locales.
For know issues see the comments on the previous ticket.
Attachments (2)
Change History (21)
#4
@
9 years ago
Actually this plugin seems to do a good job at fixing this: https://wordpress.org/plugins/word-count-with-double-byte-character/
All that plugin does is deregister the version of word counter in core and enqueue a slighly modified version. We could patch ours with their changes
#6
@
9 years ago
- Keywords has-patch added; needs-patch dev-feedback removed
- Owner set to chriscct7
- Status changed from new to accepted
If #30966 doesn't ship with 4.3, this should be so we can at least provide accurate word counts for multibyte character words in 4.3 now that we support them fully.
#7
@
9 years ago
- Milestone changed from Future Release to 4.3
This ticket was mentioned in Slack in #core-editor by chriscct7. View the logs.
9 years ago
This ticket was mentioned in Slack in #core-editor by chriscct7. View the logs.
9 years ago
#15
follow-up:
↓ 16
@
9 years ago
- Keywords needs-unit-tests added
@chriscct7 We'll also need some basic unit tests for this.
#16
in reply to:
↑ 15
@
9 years ago
Replying to iseulde:
@chriscct7 We'll also need some basic unit tests for this.
If someone can write them, I can look over them if needed. I don't think I'll have the time to come up with a robust set of tests before my (college) classes for the day start in 10 minutes.
#17
follow-up:
↓ 18
@
9 years ago
- Keywords close added; has-patch needs-unit-tests removed
Looking at 20738.2.patch, it has three loops, one of them nested and is testing each individual character, twice. This seems far too slow in longer posts. It would count any non-ASCII char, including emoji, etc.
Also, seems the character count works differently for Japanese and Chinese, one counts spaces, the other doesn't according to the comments and patches on the original ticket: https://core.trac.wordpress.org/ticket/8759#comment:15.
In that terms maybe it will be better to concentrate on #30966 and close this one as "close enough" duplicate.
#18
in reply to:
↑ 17
@
9 years ago
- Milestone 4.3 deleted
- Resolution set to duplicate
- Status changed from accepted to closed
Now that we have utf8mb4 done, has anyone tested to see if the word counter works for languages like Chinese? There is/was a plugin for this: https://wordpress.org/plugins/chinese-word-count/