From 2555d24c513f088584348d98ee2eab035b8c1955 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Thu, 11 May 2017 15:27:26 +1000 Subject: [PATCH] Treat \n and \r same as other escaped characters b'\n' and b'\r' should be serialized to '\\a ' and '\\d ' respectively, rather than '\\A ' and '\\D '. Simply let them be treated the same way as other escaped character should be fine. --- src/serializer.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/serializer.rs b/src/serializer.rs index 10711e1f..9f7a4aa5 100644 --- a/src/serializer.rs +++ b/src/serializer.rs @@ -253,8 +253,6 @@ impl<'a, W> fmt::Write for CssStringWriter<'a, W> where W: fmt::Write { let escaped = match b { b'"' => Some("\\\""), b'\\' => Some("\\\\"), - b'\n' => Some("\\A "), - b'\r' => Some("\\D "), b'\0' => Some("\u{FFFD}"), b'\x01'...b'\x1F' | b'\x7F' => None, _ => continue,