mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Don't mangle "--" in option names.
This commit is contained in:
parent
5fa895a2c4
commit
3d44c1cb7f
@ -50,6 +50,9 @@ class compact_paragraph(nodes.paragraph): pass
|
||||
# sets the highlighting language for literal blocks
|
||||
class highlightlang(nodes.Element): pass
|
||||
|
||||
# doesn't apply further text processors, e.g. smartypants
|
||||
class literal_emphasis(nodes.emphasis): pass
|
||||
|
||||
# make them known to docutils. this is needed, because the HTMl writer
|
||||
# will choke at some point if these are not added
|
||||
nodes._add_node_class_names("""index desc desc_content desc_signature
|
||||
|
@ -20,16 +20,16 @@ ws_re = re.compile(r'\s+')
|
||||
|
||||
generic_docroles = {
|
||||
'command' : nodes.strong,
|
||||
'dfn' : nodes.emphasis,
|
||||
'dfn' : addnodes.literal_emphasis,
|
||||
'guilabel' : nodes.strong,
|
||||
'kbd' : nodes.literal,
|
||||
'keyword' : nodes.literal,
|
||||
'mailheader' : nodes.emphasis,
|
||||
'mailheader' : addnodes.literal_emphasis,
|
||||
'makevar' : nodes.Text,
|
||||
'manpage' : nodes.emphasis,
|
||||
'mimetype' : nodes.emphasis,
|
||||
'newsgroup' : nodes.emphasis,
|
||||
'option' : nodes.emphasis,
|
||||
'manpage' : addnodes.literal_emphasis,
|
||||
'mimetype' : addnodes.literal_emphasis,
|
||||
'newsgroup' : addnodes.literal_emphasis,
|
||||
'option' : addnodes.literal_emphasis,
|
||||
'program' : nodes.strong,
|
||||
'regexp' : nodes.literal,
|
||||
}
|
||||
|
@ -196,6 +196,12 @@ class HTMLTranslator(BaseTranslator):
|
||||
def visit_index(self, node):
|
||||
raise nodes.SkipNode
|
||||
|
||||
# these are only handled specially in the SmartyPantsHTMLTranslator
|
||||
def visit_literal_emphasis(self, node):
|
||||
return self.visit_emphasis(node)
|
||||
def depart_literal_emphasis(self, node):
|
||||
return self.depart_emphasis(node)
|
||||
|
||||
|
||||
class SmartyPantsHTMLTranslator(HTMLTranslator):
|
||||
"""
|
||||
@ -215,6 +221,14 @@ class SmartyPantsHTMLTranslator(HTMLTranslator):
|
||||
finally:
|
||||
self.no_smarty -= 1
|
||||
|
||||
def visit_literal_emphasis(self, node):
|
||||
self.no_smarty += 1
|
||||
self.visit_emphasis(node)
|
||||
|
||||
def depart_literal_emphasis(self, node):
|
||||
self.depart_emphasis(node)
|
||||
self.no_smarty -= 1
|
||||
|
||||
def visit_productionlist(self, node):
|
||||
self.no_smarty += 1
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user