Bugs to be fixed
----------------
+- [X] w3m: & in URLs confuse rendering
+- [ ] line break in <a hseq="2"\nhref=..... isn't handled.
+- [ ] utf-8 output from w3m gets displayed a bytes!!
+- [ ] email: when alternative/1 is related and text/html, is isn't
+ displayed by default.
- [ ] email: when a convertion pane is created on a 'text' component
it should be given utf-8 and not have to use "bytes" like html does.
- [ ] renderline *knows* about scaling and when it places the cursor
m = edlib.Mark(doc)
bold = False; internal = False; imgalt = False; url = None
while True:
+ prev_end = m.dup()
try:
if bold or internal or url or imgalt:
len = doc.call("text-search", "(^.|<[^>]*>)", m)
len -= 1
except:
break
+
if len == 1:
# Found start of line - re-assert things
if bold:
i += 1
doc.call('doc:set-attr', 1, st, "render:hide", "%d" % len)
+ # We only parse entities between tags, not within them
+ parse_entities(doc, prev_end, st)
+
tag = doc.call("doc:get-str", st, m, ret='str')
tagl = tag.lower()
if tagl == "<b>":
doc.call("doc:set-attr", 1, m, "render:url-end", urltag)
url = None; urltag = None
- m = edlib.Mark(doc)
+def parse_entities(doc, m, end):
while True:
+ edlib.LOG("e", m, end)
try:
- len = doc.call("text-search", "&[#A-Za-z0-9]*;", m)
+ len = doc.call("text-search", "&[#A-Za-z0-9]*;", m, end)
len -= 1
except:
break