Commit a285ce99 authored by Lars Magne Ingebrigtsen's avatar Lars Magne Ingebrigtsen
Browse files

(eww-add-bookmark): Remove newlines from the title.

parent 2b4f0506
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
(eww-mode-map): Add a menu bar. (eww-mode-map): Add a menu bar.
(eww-add-bookmark): New command. (eww-add-bookmark): New command.
(eww-bookmark-mode): New mode and commands. (eww-bookmark-mode): New mode and commands.
(eww-add-bookmark): Remove newlines from the title.
2013-06-26 Glenn Morris <rgm@gnu.org> 2013-06-26 Glenn Morris <rgm@gnu.org>
......
...@@ -950,10 +950,12 @@ The browser to used is specified by the `shr-external-browser' variable." ...@@ -950,10 +950,12 @@ The browser to used is specified by the `shr-external-browser' variable."
(when (equal eww-current-url (when (equal eww-current-url
(plist-get bookmark :url)) (plist-get bookmark :url))
(error "Already bookmarked"))) (error "Already bookmarked")))
(push (list :url eww-current-url (let ((title (replace-regexp-in-string "[\n\t\r]" " " eww-current-title)))
:title eww-current-title (setq title (replace-regexp-in-string "\\` +\\| +\\'" "" title))
:time (current-time-string)) (push (list :url eww-current-url
eww-bookmarks) :title title
:time (current-time-string))
eww-bookmarks))
(eww-write-bookmarks) (eww-write-bookmarks)
(message "Bookmarked %s (%s)" eww-current-url eww-current-title)) (message "Bookmarked %s (%s)" eww-current-url eww-current-title))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment