mirror of
https://github.com/ArthurSonzogni/Diagon.git
synced 2026-08-29 08:34:44 +08:00
Tree: Ignore empty lines.
Fixed:https://github.com/ArthurSonzogni/Diagon/issues/58
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
# Current
|
# Current
|
||||||
|
|
||||||
|
- Tree: Ignore emtpy lines.
|
||||||
|
|
||||||
|
|
||||||
# 1.1.156 (2023-05-08)
|
# 1.1.156 (2023-05-08)
|
||||||
|
|
||||||
## Security:
|
## Security:
|
||||||
|
|||||||
@@ -319,8 +319,16 @@ class Tree : public Translator {
|
|||||||
lines.push_back(line);
|
lines.push_back(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lines.size() == 0)
|
if (lines.size() == 0) {
|
||||||
return "";
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove empty lines.
|
||||||
|
// See https://github.com/ArthurSonzogni/Diagon/issues/58
|
||||||
|
lines.erase(std::remove_if(
|
||||||
|
lines.begin(), lines.end(),
|
||||||
|
[](const Line& line) { return line.content.size() == 0; }),
|
||||||
|
lines.end());
|
||||||
|
|
||||||
// Build the tree.
|
// Build the tree.
|
||||||
auto tree = std::make_unique<Node>();
|
auto tree = std::make_unique<Node>();
|
||||||
|
|||||||
Reference in New Issue
Block a user