about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/layout/engine.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/layout/engine.nim b/src/layout/engine.nim
index 20793cbc..2498da49 100644
--- a/src/layout/engine.nim
+++ b/src/layout/engine.nim
@@ -80,7 +80,9 @@ func cellheight(ictx: InlineContext): LayoutUnit =
 func computeShift(ictx: InlineContext, computed: CSSComputedValues):
     LayoutUnit =
   if ictx.whitespacenum > 0:
-    if ictx.currentLine.atoms.len > 0 or computed.whitespacepre:
+    if ictx.currentLine.atoms.len > 0 and
+        not (ictx.currentLine.atoms[^1] of InlineSpacing) or
+        computed.whitespacepre:
       let spacing = computed{"word-spacing"}
       if spacing.auto:
         return ictx.cellwidth * ictx.whitespacenum