mirror of
https://github.com/Hopiu/micro.git
synced 2026-04-25 08:34:44 +00:00
Properly escape start and end regexes
This commit is contained in:
parent
523f75654d
commit
fa7f89a400
1 changed files with 2 additions and 2 deletions
|
|
@ -148,8 +148,8 @@ func generateFile(filetype, syntax, header string, rules []interface{}) string {
|
|||
output += fmt.Sprintf(" - %s: \"%s\"\n", rule.color, strings.Replace(strings.Replace(rule.regex, "\\", "\\\\", -1), "\"", "\\\"", -1))
|
||||
} else if rule, ok := r.(MultiRule); ok {
|
||||
output += fmt.Sprintf(" - %s:\n", rule.color)
|
||||
output += fmt.Sprintf(" start: \"%s\"\n", rule.start)
|
||||
output += fmt.Sprintf(" end: \"%s\"\n", rule.end)
|
||||
output += fmt.Sprintf(" start: \"%s\"\n", strings.Replace(strings.Replace(rule.start, "\\", "\\\\", -1), "\"", "\\\"", -1))
|
||||
output += fmt.Sprintf(" end: \"%s\"\n", strings.Replace(strings.Replace(rule.end, "\\", "\\\\", -1), "\"", "\\\"", -1))
|
||||
output += fmt.Sprintf(" rules: []\n\n")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue