escape NP, take 2

re-implemented #1538  to modify link on click

`<base>` broke too much ajax, hopefully this won't break too much..