diff-renderer icon indicating copy to clipboard operation
diff-renderer copied to clipboard

urls in style tags break

Open johan-olsson opened this issue 7 years ago • 5 comments

When I update element containing style urls I get weird results, for example:

<style>
  div {
    background-image: url(http://some.image.jpg)
  }
</style>

becomes:

<style>
  div {
    background-image: url(http:</style>

Am I missing something?

johan-olsson avatar May 24 '17 20:05 johan-olsson

hah, didn't know someone is using this project, its an experiment, not battle tested, I would merge a pr though.

kof avatar May 24 '17 20:05 kof

Cool, I'm happy to create one. Where would you start looking? ;)

johan-olsson avatar May 24 '17 20:05 johan-olsson

Never mind, I found it. It's a problem with the serialize-html. The slashes seems to be treated as closing tags. I think an exception for style and script tags could do it since they can't have children anyways.

johan-olsson avatar May 24 '17 20:05 johan-olsson

slashes are possible anywhere

kof avatar May 24 '17 21:05 kof

True that, I thought they would get encoded by the browser parser for some reason.

johan-olsson avatar May 24 '17 22:05 johan-olsson