mirror of
https://github.com/vale981/recommonmark
synced 2025-03-05 10:01:39 -05:00
Add a reference to the XRefRole class
This commit is contained in:
parent
a9459aabfa
commit
e9bac97518
1 changed files with 3 additions and 1 deletions
|
@ -227,7 +227,9 @@ def inline_entity(inline):
|
|||
entity_node = nodes.paragraph('', val, format='html')
|
||||
return entity_node
|
||||
|
||||
|
||||
# The goal is to make references work like the `:any:` role except when an url
|
||||
# is given. See the XRefRole class in sphinx:
|
||||
# https://github.com/sphinx-doc/sphinx/blob/master/sphinx/roles.py
|
||||
def make_refnode(label, target, has_explicit_title):
|
||||
if target and target.startswith(('http://', 'https://')):
|
||||
ref_node = nodes.reference()
|
||||
|
|
Loading…
Add table
Reference in a new issue