Search code examples
special-characterspython-sphinxrestructuredtext

Special Characters in Hyperlinks - Sphinx


Suppose, I want to link "http://www.google.com" with the text Search & Learn. How do I use that in Sphinx ?

E.g. text : Now you can `Search & Learn`_.

.. _Search & Learn: http://www.google.com doesn't work as there's & in the text.


Solution

  • The problem is the link syntax, not the & character.

    The underscore must come after the second backtick, like this:

    `Search & Learn`_