Skip to content

Conversation

@ncoop57
Copy link

@ncoop57 ncoop57 commented Nov 19, 2024

This PR improves the regex detection for doclinks in nbdev. Specifically it now handles parenthesis being included in backticks:

md = """This is a link to `numpy.array` and to `get_config()` but not a link to `foobar`.
And not a link to <code>dict2nb</code>.

    This is not a link to `get_config`
"""
print(NbdevLookup('nbdev').linkify(md))
This is a link to [`numpy.array`](https://numpy.org/doc/stable/reference/generated/numpy.array.html#numpy.array) and to [`get_config()`](https://nbdev.fast.ai/api/config.html#get_config) but not a link to `foobar`.
And not a link to <code>dict2nb</code>.

    This is not a link to `get_config`

Additional tests were also added to check against edge cases.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@ncoop57
Copy link
Author

ncoop57 commented Nov 19, 2024

@jph00
Copy link
Contributor

jph00 commented Nov 19, 2024

Great stuff @ncoop57 :D

@jph00 jph00 merged commit ccdc0b6 into AnswerDotAI:main Nov 19, 2024
10 checks passed
@ncoop57 ncoop57 deleted the regex branch November 20, 2024 00:04
@jph00 jph00 added the enhancement New feature or request label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

2 participants