MCPcopy
hub / github.com/sphinx-doc/sphinx / encode

Method encode

sphinx/writers/latex.py:2487–2493  ·  view source on GitHub ↗
(self, text: str)

Source from the content-addressed store, hash-verified

2485 # text handling
2486
2487 def encode(self, text: str) -> str:
2488 text = self.escape(text)
2489 if self.literal_whitespace:
2490 # Insert a blank before the newline, to avoid
2491 # ! LaTeX Error: There's no line here to end.
2492 text = text.replace(CR, r'~\\' + CR).replace(' ', '~')
2493 return text
2494
2495 def encode_uri(self, text: str) -> str:
2496 # TODO: it is probably wrong that this uses texescape.escape()

Callers 15

generateMethod · 0.95
escapeMethod · 0.95
visit_abbreviationMethod · 0.95
visit_thebibliographyMethod · 0.95
visit_citationMethod · 0.95
visit_option_stringMethod · 0.95
encode_uriMethod · 0.95
visit_TextMethod · 0.95
terminal_safeFunction · 0.80
splitMethod · 0.80
init_ctypesMethod · 0.80
_check_uriMethod · 0.80

Calls 2

escapeMethod · 0.95
replaceMethod · 0.80

Tested by 7

writeMethod · 0.64
do_GETMethod · 0.64
_encode_chunkMethod · 0.64
_chunk_contentMethod · 0.64
custom_handlerFunction · 0.64
serialiseMethod · 0.64
_write_headersMethod · 0.64