Now with real glyphs
[naja.git] / naja / widgets / text.py
index c4ac45600ec398a5679656eb668dbb3c174d41ce..5dac4e622952b6f3407df7f95e622cf8db1498aa 100644 (file)
@@ -13,6 +13,7 @@ MARKUP_MAP = {
     'SOUTH': ('glyphs/arrow_down.png', None),
     'EAST': ('glyphs/arrow_right.png', None),
     'WEST': ('glyphs/arrow_left.png', None),
+    'RETURN': ('glyphs/return.png', None),
     'HEALTH': ('glyphs/health.png', PALETTE.DARK_RED),
     'WINTOKEN': ('glyphs/win.png', PALETTE.DARK_OLIVE),
     'KEY': ('glyphs/key.png', None),
@@ -173,6 +174,8 @@ class TextBoxWidget(TextWidget):
             suffix = word[-1]
             word = word[:-1]
 
+        if not word:
+            return None
         if word[0] == '{' and word[-1] == '}':
             subwords = word[1:-1].split(',')
             if all(subword in MARKUP_MAP for subword in subwords):