diff --git a/sphinx_exercise/post_transforms.py b/sphinx_exercise/post_transforms.py index 1235f30..d9a0fd7 100644 --- a/sphinx_exercise/post_transforms.py +++ b/sphinx_exercise/post_transforms.py @@ -66,7 +66,8 @@ def run(self): # Get Metadata from Inline inline = node.children[0] classes = inline["classes"] - classes.remove("std-ref") + if "std-ref" in classes: + classes.remove("std-ref") classes.append("std-numref") # Construct a Literal Node literal = docutil_nodes.literal()