implement a DOM alternative to REGEXP for autolinks