File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626#include < cstdlib>
2727#include < utility>
2828#include < variant>
29+ #include < cctype>
30+ #include < string_view>
2931
3032namespace vix ::template_
3133{
@@ -61,6 +63,19 @@ namespace vix::template_
6163 return true ;
6264 }
6365
66+ [[nodiscard]] bool is_whitespace_only (std::string_view text) noexcept
67+ {
68+ for (const unsigned char c : text)
69+ {
70+ if (!std::isspace (c))
71+ {
72+ return false ;
73+ }
74+ }
75+
76+ return true ;
77+ }
78+
6479 [[nodiscard]] bool is_floating_literal (const std::string &value) noexcept
6580 {
6681 if (value.empty ())
@@ -848,6 +863,15 @@ namespace vix::template_
848863 continue ;
849864 }
850865
866+ if (child->type () == NodeType::Text)
867+ {
868+ const auto &text = static_cast <const TextNode &>(*child);
869+ if (is_whitespace_only (text.value ()))
870+ {
871+ continue ;
872+ }
873+ }
874+
851875 if (child->type () != NodeType::Block)
852876 {
853877 throw RendererError (
You can’t perform that action at this time.
0 commit comments