3
0
Fork 0
forked from mirrors/nixpkgs

nixos/make-options-doc: Escape inline code and code blocks

This commit is contained in:
Robert Hensing 2022-06-27 17:32:27 +02:00
parent f900ed1749
commit e04aa1bcd9

View file

@ -68,10 +68,10 @@ def convertMD(options: Dict[str, Any]) -> str:
def newline(self):
return "<literallayout>\n</literallayout>"
def codespan(self, text):
return f"<literal>{text}</literal>"
return f"<literal>{escape(text)}</literal>"
def block_code(self, text, info=None):
info = f" language={quoteattr(info)}" if info is not None else ""
return f"<programlisting{info}>\n{text}</programlisting>"
return f"<programlisting{info}>\n{escape(text)}</programlisting>"
def link(self, link, text=None, title=None):
if link[0:1] == '#':
attr = "linkend"