Skip to content

Copying linked files fails with embedded SVG <a> elements #139

@rakuco

Description

@rakuco

#132 seems to have introduced a bug that can be reproduced when running build.js on https://github.com/w3c/sensors/2b77580c9d7fb2ecb68c5ef264d2ce5c69f5c901/main/index.bs.

The output is not very helpful and looks like this:

    [INFO] Finding relevant assets…
      [INFO] From /index.bs.built.html…
      Invalid URL

Running things manually and adding some debugging, the problem is in sidvishnoi/subresources@f7061df: getLinks() uses "a[href]" as a selector, which ends up including <a> elements inside <svg> documents. These <a> elements are SVGAElements though, and their href attribute returns an object instead of a string, and it breaks findAssetsToCopy in this repository.

I'm filing this issue because I'm not sure if the idea was to ignore links in embedded SVG or if they need to be properly parsed instead (the links in the Generic Sensor spec refer to anchors in the actual spec and thus outside the SVG document, for example).

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions