Address issue in which slashes weren't being appropriately trimmed for p...

Addresses https://github.com/yui/yui3/issues/1964

@caridy @ericf @juandopazo