Improve new syntax files and fix a region glitch

This commit is contained in:
Zachary Yedidia
2017-03-21 15:07:39 -04:00
parent b977bf5cca
commit 54bb99d758
67 changed files with 2941 additions and 642 deletions

View File

@@ -135,10 +135,10 @@ func generateFile(filetype, syntax, header string, rules []interface{}) string {
output := ""
output += fmt.Sprintf("filetype: %s\n\n", filetype)
output += fmt.Sprintf("detect: \n filename: \"%s\"\n", strings.Replace(syntax, "\\", "\\\\", -1))
output += fmt.Sprintf("detect: \n filename: \"%s\"\n", strings.Replace(strings.Replace(syntax, "\\", "\\\\", -1), "\"", "\\\"", -1))
if header != "" {
output += fmt.Sprintf(" header: \"%s\"\n", strings.Replace(header, "\\", "\\\\", -1))
output += fmt.Sprintf(" header: \"%s\"\n", strings.Replace(strings.Replace(header, "\\", "\\\\", -1), "\"", "\\\"", -1))
}
output += "\nrules:\n"