diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-02-17 21:50:37 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-02-17 21:50:37 +0100 |
commit | 5b81eff34f0e8448fe0a3ffb9b82cbadcd78416a (patch) | |
tree | 95d8c2753c1032954c32f5d7ab5f810444ecbce7 | |
parent | 0422fd52aadf33ab895a60905f21f737e25bf011 (diff) |
Fix for issue #79 -- do not create implicit default fields for invalid commands
-rw-r--r-- | src/core/parser/stack/Stack.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/parser/stack/Stack.cpp b/src/core/parser/stack/Stack.cpp index 07f7d8c..08f86e5 100644 --- a/src/core/parser/stack/Stack.cpp +++ b/src/core/parser/stack/Stack.cpp @@ -276,7 +276,7 @@ void Stack::endOverdueHandlers() HandlerInfo &info = stack.back(); // Abort if this handler currently is inside a field - if (info.inField || !info.hadDefaultField) { + if (info.inField || (!info.hadDefaultField && info.valid)) { return; } @@ -291,8 +291,9 @@ bool Stack::ensureHandlerIsInField() // try to start a default field HandlerInfo &info = currentInfo(); if (!info.inField && info.handler != nullptr) { - // Abort if the element already had a default field - if (info.hadDefaultField) { + // Abort if the element already had a default field or the handler is + // not valid + if (info.hadDefaultField || !info.valid) { return false; } |