mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-11 20:03:58 +02:00
tpl/transform: Add template func for TOML/JSON/YAML docs examples conversion
Usage: ```html {{ "title = \"Hello World\"" | transform.Remarshal "json" | safeHTML }} ``` Fixes #4389
This commit is contained in:
@@ -465,3 +465,9 @@ func DiffStringSlices(slice1 []string, slice2 []string) []string {
|
||||
|
||||
return diffStr
|
||||
}
|
||||
|
||||
// DiffString splits the strings into fields and runs it into DiffStringSlices.
|
||||
// Useful for tests.
|
||||
func DiffStrings(s1, s2 string) []string {
|
||||
return DiffStringSlices(strings.Fields(s1), strings.Fields(s2))
|
||||
}
|
||||
|
Reference in New Issue
Block a user