From ddb40db49062d477eaf09ca5309f01076ca9c10b Mon Sep 17 00:00:00 2001
From: patrick96
Date: Fri, 28 Dec 2018 17:16:43 +0100
Subject: [PATCH] builder: Cleanup label over-/underline handling
There really is no reason to also close over/underline tags when we have
a right margin and a non-black over/underline color.
The git blame for these lines also doesn't give us any insights as to
why it was done this way.
---
src/components/builder.cpp | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/src/components/builder.cpp b/src/components/builder.cpp
index fa21463f..2180e9a6 100644
--- a/src/components/builder.cpp
+++ b/src/components/builder.cpp
@@ -208,11 +208,6 @@ void builder::node(const label_t& label, bool add_space) {
auto text = get_label_text(label);
- // if ((label->m_overline.empty() && m_tags[syntaxtag::o] > 0) || (m_tags[syntaxtag::o] > 0 && label->m_margin > 0))
- // overline_close();
- // if ((label->m_underline.empty() && m_tags[syntaxtag::u] > 0) || (m_tags[syntaxtag::u] > 0 && label->m_margin > 0))
- // underline_close();
-
if (label->m_margin.left > 0) {
space(label->m_margin.left);
}
@@ -248,10 +243,10 @@ void builder::node(const label_t& label, bool add_space) {
color_close();
}
- if (!label->m_underline.empty() || (label->m_margin.right > 0 && m_tags[syntaxtag::u] > 0)) {
+ if (!label->m_underline.empty()) {
underline_close();
}
- if (!label->m_overline.empty() || (label->m_margin.right > 0 && m_tags[syntaxtag::o] > 0)) {
+ if (!label->m_overline.empty()) {
overline_close();
}