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

IE11: normalize does not merge the splitted text. #13

Open
sadikr opened this issue Jul 2, 2018 · 1 comment
Open

IE11: normalize does not merge the splitted text. #13

sadikr opened this issue Jul 2, 2018 · 1 comment

Comments

@sadikr
Copy link

sadikr commented Jul 2, 2018

IE11 does not merge the text node correctly, we need to put a work around for this. may be the following one..
Issue: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8727426/

function normalize (node) {
  if (!node) { return; }
  if (node.nodeType == 3) {
    while (node.nextSibling && node.nextSibling.nodeType == 3) {
      node.nodeValue += node.nextSibling.nodeValue;
      node.parentNode.removeChild(node.nextSibling);
    }
  } else {
    normalize(node.firstChild);
  }
  normalize(node.nextSibling);
}
@jaberu
Copy link
Contributor

jaberu commented Jul 26, 2019

I had the same problem. sadikrs suggestion worked for me.
still looks fine in Chrome and firefox
I created a pull request if you like to apply
#16

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