Skip to content

Commit

Permalink
Don't remove whitespace from xml text element
Browse files Browse the repository at this point in the history
IB-8297

Signed-off-by: Raul Metsma <[email protected]>
  • Loading branch information
metsma committed Nov 20, 2024
1 parent aba89db commit b7e6768
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/XMLDocument.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,8 @@ struct XMLElem

constexpr operator sv() const noexcept
{
constexpr sv whitespace {" \n\r\f\t\v"};
auto *text = children(&value_type::children, XML_TEXT_NODE);
auto result = to_string_view(text, &std::decay_t<decltype(*text)>::content);
result.remove_prefix(std::min<size_t>(result.find_first_not_of(whitespace), result.size()));
return result;
return to_string_view(text, &std::decay_t<decltype(*text)>::content);
}

pointer d{};
Expand Down

0 comments on commit b7e6768

Please sign in to comment.