Skip to content
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

Generating the right rST for formatting within links #41

Open
micahjsmith opened this issue Oct 24, 2021 · 2 comments
Open

Generating the right rST for formatting within links #41

micahjsmith opened this issue Oct 24, 2021 · 2 comments

Comments

@micahjsmith
Copy link

In markdown, one can do format the text of a link without any problems

[`my.api.method`](http://example.com)

However, from this m2r2 generates

``my.api.method` <http://example.com>`_

This is not valid rST and just renders literally.

We'd like to generate the following HTML:

<a href="http://example.com"><code>my.api.method</code></a>

This isn't really the "fault" of m2r2, as rST doesn't really support this construct. A workaround is here. Perhaps m2r2 could implement this workaround? Seems pretty messy unfortunately.

@CrossNox
Copy link
Owner

Related to #36
As you said, rST does not allow these kind of constructs.

I'm happy to look at a PR with a small test suite, with a config that allows for having this "fail"/use the workaround.

@endolith
Copy link

Same problem for me. My .md has

As of this README, it includes  [`numpy`](https://numpy.org/) and 
[`scipy`](https://www.scipy.org/)for the simulations, 
[`tabulate`](https://github.com/astanin/python-tabulate) for printing 
example tables, [`joblib`](https://joblib.readthedocs.io/en/latest/) for
parallelizing extreme examples, and  [`pytest`](https://docs.pytest.org/en/latest/), …

etc and it mangles all of them:

image

Can it just strip the `` tags when converting to rst if they aren't supported?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants