Spaces:
Running
Running
Amlan-109
feat: Initial commit of LocalAI Amlan Edition with premium branding and personalization
750bbe6 Download pkg/utils/json.go from Zyan11/LocalAI-Amlan-Edition: direct link, hf CLI and curl.
- Browser
- Download file 318 Bytes
-
https://huggingface.co/spaces/Zyan11/LocalAI-Amlan-Edition/resolve/main/pkg/utils/json.go
- Command line
-
hf download hf://spaces/Zyan11/LocalAI-Amlan-Edition/pkg/utils/json.go
-
curl -L -o json.go https://huggingface.co/spaces/Zyan11/LocalAI-Amlan-Edition/resolve/main/pkg/utils/json.go
318 Bytes
| package utils | |
| import "regexp" | |
| var matchNewlines = regexp.MustCompile(`[\r\n]`) | |
| const doubleQuote = `"[^"\\]*(?:\\[\s\S][^"\\]*)*"` | |
| func EscapeNewLines(s string) string { | |
| return regexp.MustCompile(doubleQuote).ReplaceAllStringFunc(s, func(s string) string { | |
| return matchNewlines.ReplaceAllString(s, "\\n") | |
| }) | |
| } | |