[wp-trac] [WordPress Trac] #55484: class-wp-editor.php line 1697
WordPress Trac
noreply at wordpress.org
Thu Mar 31 19:32:19 UTC 2022
#55484: class-wp-editor.php line 1697
--------------------------+------------------------------
Reporter: karin2 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version: 5.9.2
Severity: normal | Resolution:
Keywords: | Focuses: javascript
--------------------------+------------------------------
Comment (by karin2):
Keep in mind that all JavaScript for this area is compressed into one
line. Thus causing the error.
**Code causing error:**
----
var initialize = function(){...}if (typeof tinymce !== 'undefined'){...
----
**Browsers tested:**
Firefox:
98.0.2 (64-bit)
----
Uncaught SyntaxError: unexpected token: keyword 'if'
----
Chrome
100.0.4896.60 (64-bit)
----
Uncaught SyntaxError: Unexpected token 'if'
----
Most likely all other browsers as well. Since when the JavaScript is
compressed, ie: one line, there is no semicolon to define the ending of
the statement.
Portions of the TinyMCE editor is broken, as well. Endless loader and the
TinyMCE buttons are not displayed.
When the semicolon is applied, as below, the error is gone and everything
is working.
**The Fix: (Adding Semicolon)**
----
var initialize = function(){....};if (typeof tinymce !== 'undefined'){....
----
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55484#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list