diff options
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/data/uzbl/scripts/uzbl_tabbed.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/examples/data/uzbl/scripts/uzbl_tabbed.py b/examples/data/uzbl/scripts/uzbl_tabbed.py index bf5ee97..d384fc6 100755 --- a/examples/data/uzbl/scripts/uzbl_tabbed.py +++ b/examples/data/uzbl/scripts/uzbl_tabbed.py @@ -34,6 +34,9 @@ # Contributor(s): # mxey <mxey@ghosthacking.net> # uzbl_config path now honors XDG_CONFIG_HOME if it exists. +# +# Romain Bignon <romain@peerfuse.org> +# Fix for session restoration code. # Configuration: @@ -301,6 +304,14 @@ def counter(): yield i +def escape(s): + '''Replaces html markup in tab titles that screw around with pango.''' + + for (split, glue) in [('&','&'), ('<', '<'), ('>', '>')]: + s = s.replace(split, glue) + return s + + def gen_endmarker(): '''Generates a random md5 for socket message-termination endmarkers.''' @@ -984,7 +995,8 @@ class UzblTabbed: (tabc, textc) = style if tab_titles: - pango += tab_format % (tabc, index, textc, tabtitle) + pango += tab_format % (tabc, index, textc,\ + escape(tabtitle)) else: pango += tab_format % (tabc, textc, index) @@ -1064,7 +1076,7 @@ if __name__ == "__main__": uzbl.new_tab(line, False) if not len(urls): - self.new_tab() + uzbl.new_tab() else: uzbl.new_tab() |