base_path matches the start of string rather than the start of line
Merge pull request #1 from weilu/master

Fix for links preceded by a newline