article: improve url detection and move it into another file.

Chars ')]}' at the end of URL is removed unless there is a matching pair.