Opened 10 years ago
Closed 10 years ago
#34191 closed defect (bug) (fixed)
Shortcode JS Missed in r33118
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.4 | Priority: | normal |
| Severity: | normal | Version: | 4.3 |
| Component: | Shortcodes | Keywords: | |
| Focuses: | javascript | Cc: |
Description
The shortcode attribute parser in Javascript no longer matches the PHP code.
Attachments (2)
Change History (11)
#4
@
10 years ago
The new test in 34191.2.patch passes for me. If I revert shortcode.js only, the new test fails as expected. Looks good to me.
Do we need to add this kind of test for the main regex as well?
#6
@
10 years ago
- Keywords fixed-major added; has-patch needs-testing removed
- Resolution fixed deleted
- Status changed from closed to reopened
#7
@
10 years ago
@miqrogroove Per discussion about adding documentation, shortcode.js (I believe) is used exclusively by mce views https://core.trac.wordpress.org/browser/tags/4.3/src/wp-includes/js/mce-view.js#L670.
I'm not sure how this would be best documented. Comment at the top of the file?
#8
@
10 years ago
There are some existing shortcode parsing tests: https://core.trac.wordpress.org/browser/trunk/tests/qunit/wp-includes/js/shortcode.js
I'll update them to cover more cases.
34191.2.patch abstracts the regex into a function so it can be unit tested to ensure the JS and PHP versions remain consistent.