def getMumpsRoutineHtmlLinks(inputString, crosRef=None): """ For a giving Mumps code, it use regular expression to parse the code section and identify all the possible routines and covert html routines to html format """ output = "" startpos = 0 for routine, tag, start in getMumpsRoutine(inputString): if routine: output += (inputString[startpos:start] + _getRoutineHRefLink(routine, crossRef=crosRef)) startpos = start + len(routine) if startpos < len(inputString): output += inputString[startpos:] if output: return output else: return inputString
def getMumpsRoutineHtmlLinks(inputString, crosRef=None): """ For a giving Mumps code, it use regular expression to parse the code section and identify all the possible routines and covert html routines to html format """ output = "" startpos = 0 endpos = 0 for routine, tag, start in getMumpsRoutine(inputString): if routine: output += inputString[startpos:start] + getRoutineHRefLink(None, routine, crossRef=crosRef) startpos = start + len(routine) if startpos < len(inputString): output += inputString[startpos:] if output: return output else: return inputString