saschanaz / webidl-updater

Crawl and find specs with autofixable invalid IDL codes.
ISC License
1 stars 1 forks source link

Enhance parsing of HTML inside Web IDL definitions #17

Open kenrussell opened 4 years ago

kenrussell commented 4 years ago

On https://github.com/KhronosGroup/WebGL/pull/3140 the auto-generated pull request erased a few HTML annotations inside the Web IDL which is embedded in the WebGL spec.

It's not difficult to undo those, though it would be ideal if the auto-filing tool could be enhanced to preserve those.

saschanaz commented 4 years ago

This would be very great but I couldn't find a good way to keep HTML annotations. The solution here would need to be clever to mix these two texts:

Input 1 - original HTML:

interface <a>Foo</a> {};

Input 2 - WebIDL validation result:

[Exposed=Window]
interface Foo {};

Preferred output:

[Exposed=Window]
interface <a>Foo</a> {};
saschanaz commented 4 years ago

Random thought: the tokeniser could accept an array of objects which include a string and its parent (<a> here). Token then could keep it for use in writer.

saschanaz commented 3 years ago

https://github.com/saschanaz/webidl-updater/issues/66 should be a workaround for now.

kenrussell commented 3 years ago

Thanks for the workaround.