go.talks/pkg/present: fix named highlights
Previously it wasn't stripping "// HLfoo" comments from lines.
R=campoy, campoy
CC=golang-dev
https://golang.org/cl/7193054
diff --git a/pkg/present/code.go b/pkg/present/code.go
index 43b3867..e27c42b 100644
--- a/pkg/present/code.go
+++ b/pkg/present/code.go
@@ -261,6 +261,10 @@
continue
}
line := m[1]
+ if m[2] != "" && m[2] != label {
+ lines[i] = line
+ continue
+ }
space := ""
if j := strings.IndexFunc(line, func(r rune) bool {
return !unicode.IsSpace(r)
@@ -268,9 +272,7 @@
space = line[:j]
line = line[j:]
}
- if m[2] == "" || m[2] == label {
- lines[i] = space + "<b>" + line + "</b>"
- }
+ lines[i] = space + "<b>" + line + "</b>"
}
return strings.Join(lines, "\n")
}