Skip to content
This repository has been archived by the owner on Jun 15, 2021. It is now read-only.

Code button in the demo not working properly #482

Open
tompazourek opened this issue Jun 9, 2016 · 2 comments
Open

Code button in the demo not working properly #482

tompazourek opened this issue Jun 9, 2016 · 2 comments
Assignees

Comments

@tompazourek
Copy link

tompazourek commented Jun 9, 2016

Hi Guardian team!

Using Chrome 51 on Windows.

When I try your current demo, the Code button is not working correctly. It is like the editor did't recognize that some text was already wrapped in <code>, so it keeps wrapping it over and over instead of removing the code formatting after second click.

How to reproduce:

  1. Open the demo
  2. Select the word World
  3. Press Code button
  4. Press Code button again

Expected: The selected word would be wrapped in <code> and then unwrapped.
Actual: The selected word is wrapped twice (<code><code>World</code></code>)

@rrees rrees self-assigned this Jun 14, 2016
@danburzo
Copy link
Contributor

danburzo commented Jun 30, 2016

I believe this is a bug with https://github.com/guardian/scribe-plugin-code-command/, specifically that the queryState does not return the correct value in Chrome. Seems like https://github.com/guardian/scribe-plugin-code-command/blob/master/src/scribe-plugin-code-command.js#L42 should read this._nodeName instead.

@shaundillon shaundillon assigned shaundillon and unassigned rrees Aug 30, 2017
@shaundillon
Copy link
Contributor

shaundillon commented Aug 30, 2017

@tompazourek, I'm looking in to this now. @danburzo, your assertion that this._nodeName contains the correct value is right, but node.nodeName is still returning the original ancestor node, not the new <code> node, leading to the same problem.

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

No branches or pull requests

4 participants