#27386 closed defect (bug) (fixed)
Editor: Word count should exclude shortcodes
Reported by: | bassgang | Owned by: | iseulde |
---|---|---|---|
Milestone: | 4.3 | Priority: | normal |
Severity: | minor | Version: | 2.3 |
Component: | Editor | Keywords: | has-patch dev-feedback needs-testing |
Focuses: | javascript | Cc: |
Description
On the post edit screen the Word count includes shortcodes, but they should not be considered as normal words and so not increase the count.
Steps to reproduce:
- Add a new post.
- Add a gallery to the newly created post.
- Save the post.
- Reload the page.
- Check "Word count" under the content textarea, it says "2".
As pointed out by azaozz: "to make that work properly we need to output an array of shortcode "names", then exclude them in the word count".
Who can provide guidance to show which is the most likely way to get this information available in JS?
Attachments (4)
Change History (12)
#3
@
11 years ago
- Keywords needs-unit-tests removed
27386.2.patch adds a (QUnit) unit test to verify that the word count feature correctly skips shortcodes when counting words. The test fails without the patch in /wp-admin/js/word-count.js and passes once the file is patched. Note: the test needs to be asynchronous because the word count function includes a brief delay and would otherwise complete after the assertion ran.
This ticket was mentioned in IRC in #wordpress-dev by adamsilverstein. View the logs.
11 years ago
#5
@
11 years ago
- Milestone changed from Awaiting Review to Future Release
- Severity changed from normal to minor
- Version changed from trunk to 2.3
Related: #27391
#6
@
11 years ago
in 27386.3.patch correct jshint errors, refresh patch, swap tabs for spaces in qunit index file
Adding patch for 27386.
Added a Regex Check for Shortcodes.
27386.patch