Allow non-latin characters in paths
This makes gmnhg use [\pL\d\-_] to match paths instead of \w, allowing letter characters from any Unicode language in file paths. Fixes #48.
This commit is contained in:
parent
ee8e58ffb9
commit
f858ec383b
2 changed files with 4 additions and 4 deletions
|
@ -149,9 +149,9 @@ const (
|
|||
)
|
||||
|
||||
var (
|
||||
tmplNameRegex = regexp.MustCompile("^" + templateBase + `([\w-_ /]+)\.gotmpl$`)
|
||||
leafIndexRegex = regexp.MustCompile("^" + contentBase + `([\w-_ /]+)/index\.[\w]+$`)
|
||||
pagePathRegex = regexp.MustCompile("^" + contentBase + `([\w-_ /]+)/([\w-_ ]+)\.md$`)
|
||||
tmplNameRegex = regexp.MustCompile("^" + templateBase + `([\pL\d\-_ /]+)\.gotmpl$`)
|
||||
leafIndexRegex = regexp.MustCompile("^" + contentBase + `([\pL\d\-_ /]+)/index\.[\pL\d_]+$`)
|
||||
pagePathRegex = regexp.MustCompile("^" + contentBase + `([\pL\d\-_ /]+)/([\pL\d\-_ ]+)\.md$`)
|
||||
)
|
||||
|
||||
var hugoConfigFiles = []string{"config.toml", "config.yaml", "config.json"}
|
||||
|
|
|
@ -62,7 +62,7 @@ var (
|
|||
yamlDelimiter = []byte("---\n")
|
||||
tomlDelimiter = []byte("+++\n")
|
||||
jsonObjectRegex = regexp.MustCompile(`\A(\{[\s\S]*\})\n\n`)
|
||||
orgModeRegex = regexp.MustCompile(`\A((?:#\+\w+\[?\]?: ?[^\n\r]*\n)+)`)
|
||||
orgModeRegex = regexp.MustCompile(`\A((?:#\+[\pL\d_]+\[?\]?: ?[^\n\r]*\n)+)`)
|
||||
)
|
||||
|
||||
// ParseMetadata extracts TOML/JSON/YAML/org-mode format front matter
|
||||
|
|
Loading…
Reference in a new issue