fixes #28 and yihui/knitr#544: should decode image URL before checking if the file exists

e.g. `foo bar.png` will be `foo%20bar.png` in src after markdownToHTML(), but we really need to use restore the URL
Merge pull request #29 from yihui/master

fix the image encoding problem
fixes #27: put ``` in \verb{}
fixes #25: typo use_xhml
fixes #26: use on.exit() inside local() so that setwd(oldwd) is executed earlier