Support {file} after '#' in go-source meta tag.

Due to the way LineFmt is currently used (see,
we need to split fileTemplate into two parts at a cut point.
Previously, the cut point has always been just before the first '#',
if present, or end of string otherwise. Now, we'll extend the cut
to include the last {file} segment, if it it appears beyond a '#'.

Some examples, where the '|' in the URL represents the cut:





Add test for a case where {file} comes after '#'.

Fixes #385.

Also, remove unintended extra `<head>` before
`<!DOCTYPE html><html><head>` in test data.

Change-Id: Ia053602b566d8b7b61b4692be76d6b0cbf866325
Reviewed-by: Andrew Gerrand <>
2 files changed