Opened 10 years ago
Closed 10 years ago
#31988 closed defect (bug) (fixed)
TinyMCE: pasting an embeddable URL in Firefox doesn't show preview
Reported by: | azaozz | Owned by: | azaozz |
---|---|---|---|
Milestone: | 4.2 | Priority: | high |
Severity: | normal | Version: | 4.2 |
Component: | TinyMCE | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
Caused by our regex test whether the selected parahraph has any text content.
When there is no text content (most common case), typeof( node.textContent || node.innerText )
is "undefined"
in Firefox but "string"
in Chrome. The regex test fails for undefined and passes for string.
Attachments (2)
Change History (11)
This ticket was mentioned in Slack in #core-editor by azaozz. View the logs.
10 years ago
#3
@
10 years ago
- Keywords has-patch added
31988.patch fixes it for me. Nice find, this has been a longstanding problem for me.
#4
@
10 years ago
It fails because Firefox does not support node.innerText
. That runs because node.textContent
may evaluate false if it's an empty string and so null is returned. Patch fixes the problem, but maybe better to use the TinyMCE API for these things?
This ticket was mentioned in Slack in #core by drew. View the logs.
10 years ago
#7
@
10 years ago
- Keywords commit added
Tested 31988.2.patch, and it also works for me. Moving for commit consideration.
In 31988.patch: if the node doesn't have
textContent
orinnerText
(for old IE), pass empty string to the regex.