forked from mirrors/nixpkgs
nixos/make-options-doc: Escape inline code and code blocks
This commit is contained in:
parent
f900ed1749
commit
e04aa1bcd9
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue