basic unittest for parseLink
add some failing test cases and fix RangeError
add ref link tests and fix [ref][] style links
strip additional spaces around title
Merge pull request #343 from dawgfoto/parseLink

test and fix markdown parseLink