MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / fixWikiCodeMarkupToCodeLinks

Function fixWikiCodeMarkupToCodeLinks

site/source/get_wiki.py:157–170  ·  view source on GitHub ↗

Links "known" code objects if they are found in wiki markup.

(aOldText)

Source from the content-addressed store, hash-verified

155 return re.sub(r'\[\[(.+?)\]\]', fixwikilinks, aOldText)
156
157 def fixWikiCodeMarkupToCodeLinks(aOldText):
158 """Links "known" code objects if they are found in wiki markup."""
159 def fixcodemarkuplinks(matchobj):
160 # print 'Inline code: %s' % matchobj.group(0)
161 # print 'matcobj1: %s' % matchobj.group(1)
162 temp_set_of_codemarkup.add(matchobj.group(0))
163 linktext = matchobj.group(1)
164 if linktext in mapped_wiki_inline_code:
165 logfile.write('Replace: %s \n' % mapped_wiki_inline_code[linktext])
166 return mapped_wiki_inline_code[linktext]
167
168 return matchobj.group(0) # linktext
169 # print 'fixing up code markup to code reference'
170 return re.sub(r'``(.+?)``', fixcodemarkuplinks, aOldText)
171
172 for file in os.listdir(output_dir):
173 if file.endswith(".rst"):

Callers 1

FixupConvertedRstFilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected