nixos/make-options-doc: Escape inline code and code blocks
This commit is contained in:
@@ -68,10 +68,10 @@ def convertMD(options: Dict[str, Any]) -> str:
|
|||||||
def newline(self):
|
def newline(self):
|
||||||
return "<literallayout>\n</literallayout>"
|
return "<literallayout>\n</literallayout>"
|
||||||
def codespan(self, text):
|
def codespan(self, text):
|
||||||
return f"<literal>{text}</literal>"
|
return f"<literal>{escape(text)}</literal>"
|
||||||
def block_code(self, text, info=None):
|
def block_code(self, text, info=None):
|
||||||
info = f" language={quoteattr(info)}" if info is not None else ""
|
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):
|
def link(self, link, text=None, title=None):
|
||||||
if link[0:1] == '#':
|
if link[0:1] == '#':
|
||||||
attr = "linkend"
|
attr = "linkend"
|
||||||
|
|||||||
Reference in New Issue
Block a user