Merge pull request #23 from ap0state/bugfix Fixed MIME type truncation on embedded images
Fabio Cevasco h3rald@h3rald.com
Tue, 14 Oct 2014 22:00:00 +0200
1 files changed,
1 insertions(+),
1 deletions(-)
jump to
M
hastyscribe.nim
→
hastyscribe.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 & "\"")