executablebooks / sphinx-comments

hypothes.is interaction layer with Sphinx
https://sphinx-comments.readthedocs.io
MIT License
20 stars 8 forks source link

[FIX] Support section elements as well as div.section #20

Open anjackson opened 1 year ago

anjackson commented 1 year ago

Investigating https://github.com/executablebooks/jupyter-book/issues/1762#issuecomment-1532896199 it seems that this module needs to be updated to support the use of <section> elements (which have superseded <div class="section"> elements).

This PR updates sphinx-comments to support both ways of working. I also noticed that (on Chrome at least) querySelectorAll returns [] when there are not matches, not null, so I've modified the script to cope there and exit cleanly rather than throw an error.

(Sorry, didn't see https://github.com/executablebooks/.github/blob/d375020a952a579cca1c1e642b248a36da606b8b/CONTRIBUTING.md#commit-messages until opening this PR so the commit message is not properly formatted.)

welcome[bot] commented 1 year ago

Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, check out EBP's Code of Conduct and our Contributing Guide, as this will greatly help the review process.
Welcome to the EBP community! :tada:

anjackson commented 1 year ago

Just noticed this largely duplicates #18 (except this supports both old and new forms).

The CI fails but it appears to be a problem with the Actions:

Error: Version 3.6 with arch x64 not found