From e07e72f497c9e2e5acb2283903fe6f465f58d36d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DOUIN?= Date: Mon, 3 May 2021 14:23:23 +0200 Subject: [PATCH] fix table with subject containing `\r\n`(#141) --- CHANGELOG.md | 5 +++++ src/table.rs | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bfd677..083ccf6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Table with subject containing `\r` or `\n`[#141] + ## [0.3.0] - 2021-04-28 ### Fixed @@ -225,3 +229,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#131]: https://github.com/soywod/himalaya/issues/131 [#132]: https://github.com/soywod/himalaya/issues/132 [#133]: https://github.com/soywod/himalaya/issues/133 +[#141]: https://github.com/soywod/himalaya/issues/141 diff --git a/src/table.rs b/src/table.rs index 50a36e9..8459dec 100644 --- a/src/table.rs +++ b/src/table.rs @@ -39,7 +39,9 @@ impl Cell { pub fn new>(value: T) -> Self { Self { styles: Vec::new(), - value: String::from(value.as_ref()), + value: String::from(value.as_ref()) + .replace("\r", "") + .replace("\n", ""), shrinkable: false, } }