def getImageFor(latexCode, charheightpx): preamble, postamble = '', '' width, height = '', '' imageFile = fileNameFor(latexCode, charheightpx, '.png') imageUrl = imagesPath + imageFile width, height = getPngSize(os.path.join(workingDir, imageFile)) #src = html_quote(re.match(latexRemoveDelim, latexCode, re.MULTILINE|re.DOTALL). group(2)) src = 'LatexWiki Image' return '%s<img alt="%s" class="equation" src="%s" width="%s" height="%s"/>%s' %(preamble, src, imageUrl, width, height, postamble)
def getImageFor(latexCode, charheightpx): preamble, postamble = '', '' width, height = '', '' imageFile = fileNameFor(latexCode, charheightpx, '.png') imageUrl = imagesPath + imageFile width, height = getPngSize(os.path.join(workingDir, imageFile)) src = html_quote(re.match(latexRemoveDelim, latexCode, re.MULTILINE|re.DOTALL).group(2)) src = re.sub(r'\n\n+', '\n', src) # FIXME collapse blank lines or they will # be interpreted as stx paragraphs -- this is an stx bug since they are # inside a tag. return '%s<img alt="%s" class="equation" src="%s" width="%s" height="%s"/>%s' %(preamble, src, imageUrl, width, height, postamble)