Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

HtmlSlateWidget's view renders empty <a>-s incorrectly (e.g. in News Item content type) #233

Open
silviubogan opened this issue Mar 8, 2022 · 0 comments
Assignees

Comments

@silviubogan
Copy link
Contributor

Steps

  1. in a browser tab with some HTML that contains a link enter DevTools, in the Elements pane select the link and remove all the content in it, so its childNodes property is an empty iterator
  2. select the link and a few surrounding visible characters from the view
  3. copy that
  4. paste it inside a HtmlSlateWidget (e.g. in a News Item)
  5. save the page with that HtmlSlateWidget
  6. the browser shows the view of the News Item
  7. open React DevTools and in it start using the tool called Select an element in the page to inspect it
  8. with it click the div with the empty paragraph with the empty link
  9. in the React DevTools in the right side pane which shows info about the currently selected element right click dangerouslySetInnerHtml and select Store as global variable
  10. also see that the view displays the link as going until the end of the paragraph since it does not understand XML/React-like autoclosing tag <a />
  11. in the DevTools console a new global variable is logged and in it you can see that it contains the HTML string with an autoclosing tag

From what I see Text blocks are not affected by this issue.

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

No branches or pull requests

1 participant