Inconsistent behavior of 'name' argument in code-block
directive
#56
Labels
bug
Something isn't working
code-block
directive
#56
Describe the bug
From limited testing, it appears that the
name:
argument requires a string to work within the{code-block}
directive. This is inconsistent with howname:
appears to work within other directives such as{figure}
or{table}
, for instance.To Reproduce
The following works for creating a label called
fig:my
that can then be used in the text via the{ref}
or{numref}
roles. This works with the table directive as well.However, the following fails to define a label (a sphinx warning about an undefined label is raised if you try to reference code:my in the document):
The following works however (note the quotes around the label name):
Expected behavior
I am not a sphinx/docutils expert, so maybe this is the expected behavior. However I would expect the
name:
argument to result in consistent behavior within all directives for which it is defined.Screenshots
n/a
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: