From 87fa2d3a60ff3515c46d50c99e19cb29bc6488ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Mon, 23 Sep 2019 20:42:30 +0200 Subject: [PATCH] Fix ANSI underline encoding, --- libcanvas/CanvasExportStore.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libcanvas/CanvasExportStore.py b/libcanvas/CanvasExportStore.py index ddae872..4c733f8 100644 --- a/libcanvas/CanvasExportStore.py +++ b/libcanvas/CanvasExportStore.py @@ -46,9 +46,12 @@ class CanvasExportStore(): outBuffer += "\u001b[1m" if inCurCell[2] & self._CellState.CS_UNDERLINE: outBuffer += "\u001b[4m" + elif (lastAttribs & self._CellState.CS_UNDERLINE) \ + and ((inCurCell[2] & self._CellState.CS_UNDERLINE) == 0): + outBuffer += "\u001b[24m" lastAttribs = inCurCell[2] if lastColours == None or lastColours != inCurCell[:2]: - if (inCurCell[0] == -1) \ + if (inCurCell[0] == -1) \ and (inCurCell[1] == -1): outBuffer += "\u001b[39;49m{}".format(" ") elif inCurCell[1] == -1: