* shr.el (shr-insert-table): Respect border-collapse: collapse.
(shr-tag-base): Protect against base specs that are degenerate.
+ (shr-ensure-paragraph): Don't delete empty lines that have text
+ properties, because these may be input fields.
* eww.el (eww-convert-widgets): Put `help-echo' on input fields so that
we can navigate to them.
(let* ((start (point))
(type (downcase (or (cdr (assq :type cont))
"text")))
+ (value (cdr (assq :value cont)))
(widget
(cond
((equal type "submit")
(list 'push-button
:notify 'eww-submit
:name (cdr (assq :name cont))
- :value (cdr (assq :value cont))
+ :value (if (zerop (length value))
+ "Submit"
+ value)
:eww-form eww-form
- (or (cdr (assq :value cont)) "Submit")))
+ (or (if (zerop (length value))
+ "Submit"
+ value))))
((or (equal type "radio")
(equal type "checkbox"))
(list 'checkbox
:notify 'eww-click-radio
:name (cdr (assq :name cont))
- :checkbox-value (cdr (assq :value cont))
+ :checkbox-value value
:checkbox-type type
:eww-form eww-form
(cdr (assq :checked cont))))
((equal type "hidden")
(list 'hidden
:name (cdr (assq :name cont))
- :value (cdr (assq :value cont))))
+ :value value))
(t
(list 'editable-field
:size (string-to-number
(or (cdr (assq :size cont))
"40"))
- :value (or (cdr (assq :value cont)) "")
+ :value value
:secret (and (equal type "password") ?*)
:action 'eww-submit
:name (cdr (assq :name cont))
(insert "\n"))
(if (save-excursion
(beginning-of-line)
- (looking-at " *$"))
+ ;; If the current line is totally blank, and doesn't even
+ ;; have any face properties set, then delete the blank
+ ;; space.
+ (and (looking-at " *$")
+ (not (get-text-property (point) 'face))
+ (not (= (next-single-property-change (point) 'face nil
+ (line-end-position))
+ (line-end-position)))))
(delete-region (match-beginning 0) (match-end 0))
(insert "\n\n")))))