summaryrefslogtreecommitdiff
path: root/src/gui/guiHyperText.h
diff options
context:
space:
mode:
authorPierre-Yves Rollo <dev@pyrollo.com>2020-03-26 19:56:35 +0100
committerGitHub <noreply@github.com>2020-03-26 19:56:35 +0100
commit49a558574f29c72733c951e1bf67ec4eabd8933b (patch)
treef5405c1b422995679d16d46ae6ea986a9ad28689 /src/gui/guiHyperText.h
parenta0998754a7bee2dfa98ddfcdf574803185a1896f (diff)
downloadminetest-49a558574f29c72733c951e1bf67ec4eabd8933b.tar.gz
minetest-49a558574f29c72733c951e1bf67ec4eabd8933b.tar.bz2
minetest-49a558574f29c72733c951e1bf67ec4eabd8933b.zip
Hypertext: Fix alignment tags adding unwanted newlines (#9548)
Diffstat (limited to 'src/gui/guiHyperText.h')
-rw-r--r--src/gui/guiHyperText.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/guiHyperText.h b/src/gui/guiHyperText.h
index 093c84ccd..c55f8a705 100644
--- a/src/gui/guiHyperText.h
+++ b/src/gui/guiHyperText.h
@@ -134,11 +134,13 @@ public:
Tag m_root_tag;
protected:
+ typedef enum { ER_NONE, ER_TAG, ER_NEWLINE } EndReason;
+
// Parser functions
void enterElement(ElementType type);
void endElement();
void enterParagraph();
- void endParagraph();
+ void endParagraph(EndReason reason);
void pushChar(wchar_t c);
ParsedText::Tag *newTag(const std::string &name, const AttrsList &attrs);
ParsedText::Tag *openTag(const std::string &name, const AttrsList &attrs);
@@ -160,6 +162,8 @@ protected:
StyleList m_style;
Element *m_element;
Paragraph *m_paragraph;
+ bool m_empty_paragraph;
+ EndReason m_end_paragraph_reason;
};
class TextDrawer