some fixes for style, make argument be used and fix regex
add tests for ethods of patchAnchorLinks directly