js pathselect: properly escape preview urls