Fix highlighting of center changes

This commit is contained in:
Kovid Goyal
2023-03-27 07:53:56 +05:30
parent de9edb6ff5
commit ccf1dfabbc
4 changed files with 27 additions and 42 deletions
+3 -4
View File
@@ -103,9 +103,9 @@ func hash_for_path(path string) (string, error) {
}
// Remove all control codes except newlines
func sanitize_control_codes(x string) string {
// exclude newlines, carriage returns and tabs
pat := utils.MustCompile("[\x00-\x08\x0b\x0c\x0e-\x1f\x7f\u0080-\u009f]")
pat := utils.MustCompile("[\x00-\x09\x0b-\x1f\x7f\u0080-\u009f]")
return pat.ReplaceAllLiteralString(x, "░")
}
@@ -114,8 +114,7 @@ func sanitize_tabs_and_carriage_returns(x string) string {
}
func sanitize(x string) string {
x = sanitize_control_codes(x)
return sanitize_tabs_and_carriage_returns(x)
return sanitize_control_codes(sanitize_tabs_and_carriage_returns(x))
}
func text_to_lines(text string) []string {