-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Link checker: use the non-greedy quantifier to parse anchors #1104
Link checker: use the non-greedy quantifier to parse anchors #1104
Conversation
Thanks for contributing to Qiskit documentation! Before your PR can be merged, it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. Thanks! 🙌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks!
Good explanation too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Can you please add a test for this?
Thank you both for the review! I added an mdx component to the test we already had 👍 |
…1104) This small PR changes the regex used in the link checker to parse the anchors for a non-greedy version of it. After regenerating the API docs with the mdx components, our link checker wasn't able to detect the id from them that we previously had as `<span>` tags. The problem was how the script was searching for the ids. In the the following screenshots, we can see the change introduced here. **Before**  **After**  More information on the non-greedy quantifier here: https://www.ibm.com/docs/en/netcoolomnibus/8.1?topic=library-minimal-non-greedy-quantifiers To see that it fixed the issue, this change was applied to #Qiskit#1094, Qiskit#1101, and Qiskit#1102
This small PR changes the regex used in the link checker to parse the anchors for a non-greedy version of it. After regenerating the API docs with the mdx components, our link checker wasn't able to detect the id from them that we previously had as
<span>
tags.The problem was how the script was searching for the ids. In the the following screenshots, we can see the change introduced here.
Before
After

More information on the non-greedy quantifier here: https://www.ibm.com/docs/en/netcoolomnibus/8.1?topic=library-minimal-non-greedy-quantifiers
To see that it fixed the issue, this change was applied to ##1094, #1101, and #1102