all repos — hastyscribe @ 39700d857da7a3cbe2b441833b25ec4dc179c56b

A professional markdown compiler.

Fixed MIME type truncation on embedded images

Except for png, the data URIs for images were being written like
data:image/mp, data:image/pg, data:image/if instead of bmp, jpg, gif.
Joshua Ellis josh@apostate.com
Tue, 14 Oct 2014 12:25:21 -0700
commit

39700d857da7a3cbe2b441833b25ec4dc179c56b

parent

56286c40eaae58c3a5edd3d4fbdab1be1995b5f9

1 files changed, 1 insertions(+), 1 deletions(-)

jump to
M hastyscribe.nimhastyscribe.nim

@@ -82,7 +82,7 @@ var matches:TImgTagStart

discard img.match(img_peg, matches) let imgfile = matches[0] if imgfile.startsWith(peg"'data:'"): continue - let pegimgformat = peg"'.' i'png' / i'jpg' / i'jpeg' / i'gif' / i'svg' / i'bmp' / i'webp' @$" + let pegimgformat = peg"'.' i'' / i'png' / i'jpg' / i'jpeg' / i'gif' / i'svg' / i'bmp' / i'webp' @$" let imgformat = imgfile.substr(imgfile.find(pegimgformat)+1, imgfile.len-1) let imgcontent = encode_image_file(current_dir & imgfile, imgformat) let imgrep = img.replace("\"" & img_file & "\"", "\"" & imgcontent & "\"")