From 48c709eb58981eabf6a0d43236c0338f25b5fd98 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Wed, 23 Nov 2016 21:59:04 +0100 Subject: [PATCH] fix(builder): Always close open tags on flush Ref #186 --- src/components/builder.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/components/builder.cpp b/src/components/builder.cpp index a367c54c..370a4215 100644 --- a/src/components/builder.cpp +++ b/src/components/builder.cpp @@ -11,17 +11,15 @@ void builder::set_lazy(bool mode) { } string builder::flush() { - if (m_lazy) { - while (m_counters[syntaxtag::A] > 0) cmd_close(true); - while (m_counters[syntaxtag::B] > 0) background_close(true); - while (m_counters[syntaxtag::F] > 0) color_close(true); - while (m_counters[syntaxtag::T] > 0) font_close(true); - while (m_counters[syntaxtag::Uo] > 0) overline_color_close(true); - while (m_counters[syntaxtag::Uu] > 0) underline_color_close(true); - while (m_counters[syntaxtag::U] > 0) line_color_close(true); - while (m_counters[syntaxtag::u] > 0) underline_close(true); - while (m_counters[syntaxtag::o] > 0) overline_close(true); - } + while (m_counters[syntaxtag::A] > 0) cmd_close(true); + while (m_counters[syntaxtag::B] > 0) background_close(true); + while (m_counters[syntaxtag::F] > 0) color_close(true); + while (m_counters[syntaxtag::T] > 0) font_close(true); + while (m_counters[syntaxtag::Uo] > 0) overline_color_close(true); + while (m_counters[syntaxtag::Uu] > 0) underline_color_close(true); + while (m_counters[syntaxtag::U] > 0) line_color_close(true); + while (m_counters[syntaxtag::u] > 0) underline_close(true); + while (m_counters[syntaxtag::o] > 0) overline_close(true); string output = m_output.data();