diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2020-02-20 14:44:16 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2020-02-20 14:44:16 +0100 |
commit | 55ad194922d357e7ee2c0d728a51dbfee54bcf0c (patch) | |
tree | b042a355108db02ef04461a95ea810080eac7060 /lisp | |
parent | b7d5a64f40bd4868ee0cc8b70b75e8b635e1c6c0 (diff) | |
download | emacs-55ad194922d357e7ee2c0d728a51dbfee54bcf0c.tar.gz |
Fix <button>...</button> submit button rendering in eww
* lisp/net/eww.el (eww-form-submit): Use the contents of the
<button>...</button> for the string if there is no value
(bug#39326).
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/net/eww.el | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 811d7c69209..c83884fd259 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -1107,11 +1107,13 @@ just re-display the HTML already fetched." (defun eww-form-submit (dom) (let ((start (point)) (value (dom-attr dom 'value))) - (setq value - (if (zerop (length value)) - "Submit" - value)) - (insert value) + (if (null value) + (shr-generic dom) + (insert value)) + ;; If the contents of the <button>...</button> turns out to be + ;; empty, or the value was blank, default to this: + (when (= (point) start) + (insert "Submit")) (add-face-text-property start (point) 'eww-form-submit) (put-text-property start (point) 'eww-form (list :eww-form eww-form |