From: Lars Magne Ingebrigtsen Date: Mon, 3 Nov 2014 00:35:44 +0000 (+0100) Subject: Make titles in eww prettier X-Git-Tag: emacs-25.0.90~2635^2~588 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ab657babf013822604566732d198c6ad094d5f26;p=emacs.git Make titles in eww prettier (eww-tag-title): Remove newlines and extra whitespace from the displayed title. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2288bba4c5e..b4f3f109855 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -7,6 +7,8 @@ go back to the non-readable version. (eww-display-html): Don't try to decode the text if we've been passed in a pre-parsed DOM. + (eww-tag-title): Remove newlines and extra whitespace from the + displayed title. 2014-11-02 Lars Magne Ingebrigtsen diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 954810ad0c9..2e4a7d76d8d 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -350,6 +350,10 @@ word(s) will be searched for via `eww-search-prefix'." (dolist (sub cont) (when (eq (car sub) 'text) (setq eww-current-title (concat eww-current-title (cdr sub))))) + (setq eww-current-title + (replace-regexp-in-string + "^ \\| $" "" + (replace-regexp-in-string "[ \t\r\n]+" " " eww-current-title))) (eww-update-header-line-format)) (defun eww-tag-body (cont)