Skip to content
This repository has been archived by the owner on Jan 15, 2023. It is now read-only.

Commit

Permalink
feat: additional marker layouts {~marker~} and {*marker*}
Browse files Browse the repository at this point in the history
  • Loading branch information
saitho committed May 23, 2020
1 parent 0bd3a20 commit e0e8f75
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/nginx/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ func CreateOrUpdateServerBlock(filename string, content string, m Config, marker
// Replace markers in content
var re *regexp.Regexp
for key, value := range markers {
re, _ = regexp.Compile("{#\\s*" + key + "\\s*#}")
re, _ = regexp.Compile("{#\\s*" + key + "\\s*#}") // {#marker#}
content = re.ReplaceAllString(content, value.(string))
re, _ = regexp.Compile("{~\\s*" + key + "\\s*~}") // {~marker~}
content = re.ReplaceAllString(content, value.(string))
re, _ = regexp.Compile("{\\*\\s*" + key + "\\s*\\*}") // {*marker*}
content = re.ReplaceAllString(content, value.(string))
}

Expand Down

0 comments on commit e0e8f75

Please sign in to comment.