Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

textern doesn't support Content-Type application/xhtml+xml; #40

Open
wofwofwof opened this issue Oct 12, 2018 · 3 comments
Open

textern doesn't support Content-Type application/xhtml+xml; #40

wofwofwof opened this issue Oct 12, 2018 · 3 comments

Comments

@wofwofwof
Copy link

wofwofwof commented Oct 12, 2018

When using textern on pages with content type application/xhtml+xml the shortcut doesn't seems to work.

I've tried to debug it. In shortcut.js in line 177 everything is fine. If I step further nothing happens. A breakpoint on the registerText function in content.js is not triggered.

Example page:

Example URL

@wofwofwof wofwofwof changed the title textern doesn't support Content-Type textern doesn't support Content-Type application/xhtml+xml; Oct 12, 2018
@ledo42
Copy link

ledo42 commented Nov 16, 2018

The problem lies in

content.js, line 37 and 55:

if (e.nodeName == "TEXTAREA") {

For any reason e.nodeName can return the node name in lower case. This seams to be related to the mentioned Content-Type. I am not sure if nodeName is to be guaranteed to be in upper case. If so, then this is a bug which should be fixed elsewhere. Meanwhile a workaround could be to change line 37 and 55 to

if (e.nodeName == "TEXTAREA" || e.nodeName == "textarea") {

@wofwofwof
Copy link
Author

Thanks a lot, the workaround works fine here.

@wofwofwof
Copy link
Author

@jlebon is it possible to add that fix into the code? Its really a hassle to manually add the fix on every update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants