Fix for replacing |filename| with static url

Fixes #953