diff --git a/include/wx/html/winpars.h b/include/wx/html/winpars.h
index f01c8c1900..1e268512a1 100644
--- a/include/wx/html/winpars.h
+++ b/include/wx/html/winpars.h
@@ -138,6 +138,11 @@ public:
// applies current parser state (link, sub/supscript, ...) to given cell
void ApplyStateToCell(wxHtmlCell *cell);
+ // Needs to be called after inserting a cell that interrupts the flow of
+ // the text like e.g.
and tells us to not consider any of the
+ // following space as being part of the same space run as before.
+ void StopCollapsingSpaces() { m_tmpLastWasSpace = false; }
+
#if !wxUSE_UNICODE
void SetInputEncoding(wxFontEncoding enc);
wxFontEncoding GetInputEncoding() const { return m_InputEnc; }
diff --git a/src/html/m_image.cpp b/src/html/m_image.cpp
index df6295ecc7..87aa320f80 100644
--- a/src/html/m_image.cpp
+++ b/src/html/m_image.cpp
@@ -718,6 +718,7 @@ TAG_HANDLER_BEGIN(IMG, "IMG,MAP,AREA")
m_WParser->GetPixelScale(),
al, mn);
m_WParser->ApplyStateToCell(cel);
+ m_WParser->StopCollapsingSpaces();
cel->SetId(tag.GetParam(wxT("id"))); // may be empty
cel->SetAlt(tag.GetParam(wxT("alt")));
m_WParser->GetContainer()->InsertCell(cel);