Skip to content

Commit d516f06

Browse files
authored
Merge pull request #229 from rust-embedded/trim-always
always trim whitespaces
2 parents 4b9937f + 5dd9906 commit d516f06

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

svd-parser/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
88
## Unreleased
99

1010
- Bump MSRV to 1.58.0
11+
- Ignore whitespaces around tag contents
1112

1213
## [v0.14.1] - 2022-10-23
1314

svd-parser/src/elementext.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ impl<'a, 'input> ElementExt for Node<'a, 'input> {
7070
/// Get text contained by an XML Element
7171
fn get_text(&self) -> Result<&str, SVDErrorAt> {
7272
match self.text() {
73-
Some(s) => Ok(s),
73+
// TODO: return error on `strict`
74+
Some(s) => Ok(s.trim()),
7475
// FIXME: Doesn't look good because SVDError doesn't format by itself. We already
7576
// capture the element and this information can be used for getting the name
7677
// This would fix ParseError

0 commit comments

Comments
 (0)