Fix highlighting of center changes
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user