Open
Description
Details
- Read the Docs project URL: https://prairielearn--11830.org.readthedocs.build/en/11830/question/index.html?readthedocs-diff=true
- Config: https://github.com/PrairieLearn/PrairieLearn/blob/master/.readthedocs.yml
Expected Result
When I click visual diff, it diffs correctly. Instead, it currently throws an error.
Actual Result
this.performDiff(this.cachedRemoteResponse.content);
// ...
const htmlDocument = parser.parseFromString(remoteContent, "text/html");
const oldBody = htmlDocument.documentElement.querySelector(
this.rootSelector,
);
The JS fetches this url: https://prairielearn--11830.org.readthedocs.build/_/api/v3/embed/?url=https%3A%2F%2Fprairielearn.readthedocs.io%2Fen%2Flatest%2Fquestion%2Findex.html&maincontent=main+%3E+div+%3E+div.md-content
The content it fetches is at the root selector:
It then tries to select the root node of the fetched document, and fails, since it has already fetched it!
Fix: don't select content at the root selector once it has been fetched through the embed link.
Metadata
Metadata
Assignees
Type
Projects
Status
Planned