pyld
pyld copied to clipboard
Fixed bugs in embed and remote frame context handling.
Hi!
We noticed two bugs in your code. One is in the framing algorithm when the remote frame contains a context url (the "if" was never True and if/else branches were reversed), and the other is in the _remove_embed function (lack of "enumerate" while iterating embed['parent']).
Here's a pull request with patches. We also added some unit-tests for the first bug. Because json-ld-org tests don't cover it, we had to come up with our own.
Best regards, RD Projekt
Thanks @RDProjekt! We need to take a closer look at this when we can, but it does look like we want to pull it in. We do need to get generic unit tests (that aren't just the official JSON-LD test suite) working and running in travis so we can throw more in there as needed and this could be a good start for that. We'd like, at least eventually, all of the tests (official JSON-LD test suite and our own custom ones) to run at the same time.
It would be good to try and get these tests into the main test suite. We want to be able test all implementations for these issues.