Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
6c769311
Commit
6c769311
authored
Oct 20, 2010
by
Katsumi Yamaoka
Browse files
shr.el: (shr-tag-table): Support caption, thead, and tfoot.
parent
daabcfb9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
2 deletions
+53
-2
lisp/gnus/ChangeLog
lisp/gnus/ChangeLog
+2
-0
lisp/gnus/shr.el
lisp/gnus/shr.el
+51
-2
No files found.
lisp/gnus/ChangeLog
View file @
6c769311
...
...
@@ -2,6 +2,8 @@
* shr.el (shr-find-fill-point): Shorten line if the preceding char is
kinsoku-eol regardless of shr-kinsoku-shorten.
(shr-tag-table-1): Rename from shr-tag-table; make it a subroutine.
(shr-tag-table): Support caption, thead, and tfoot.
2010-10-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
...
...
lisp/gnus/shr.el
View file @
6c769311
...
...
@@ -593,8 +593,7 @@ Return a string with image data."
;; main buffer). Now we know how much space each TD really takes, so
;; we then render everything again with the new widths, and finally
;; insert all these boxes into the main buffer.
(
defun
shr-tag-table
(
cont
)
(
shr-ensure-paragraph
)
(
defun
shr-tag-table-1
(
cont
)
(
setq
cont
(
or
(
cdr
(
assq
'tbody
cont
))
cont
))
(
let*
((
shr-inhibit-images
t
)
...
...
@@ -622,6 +621,56 @@ Return a string with image data."
(
dolist
(
elem
(
shr-find-elements
cont
'img
))
(
shr-tag-img
(
cdr
elem
))))
(
defun
shr-tag-table
(
cont
)
(
shr-ensure-paragraph
)
(
let*
((
caption
(
cdr
(
assq
'caption
cont
)))
(
header
(
cdr
(
assq
'thead
cont
)))
(
body
(
or
(
cdr
(
assq
'tbody
cont
))
cont
))
(
footer
(
cdr
(
assq
'tfoot
cont
)))
(
nheader
(
if
header
(
shr-max-columns
header
)))
(
nbody
(
if
body
(
shr-max-columns
body
)))
(
nfooter
(
if
footer
(
shr-max-columns
footer
))))
(
shr-tag-table-1
(
nconc
(
if
caption
`
((
tr
(
td
,@
caption
))))
(
if
header
(
if
footer
;; header + body + footer
(
if
(
=
nheader
nbody
)
(
if
(
=
nbody
nfooter
)
`
((
tr
(
td
(
table
(
tbody
,@
header
,@
body
,@
footer
)))))
(
if
(
=
nfooter
1
)
`
((
tr
(
td
(
table
(
tbody
,@
header
,@
body
))))
,@
footer
)
`
((
tr
(
td
(
table
(
tbody
,@
header
,@
body
))))
(
tr
(
td
(
table
(
tbody
,@
footer
)))))))
(
if
(
=
nbody
nfooter
)
`
((
tr
(
td
(
table
(
tbody
,@
header
))))
(
tr
(
td
(
table
(
tbody
,@
body
,@
footer
)))))
(
if
(
=
nfooter
1
)
`
((
tr
(
td
(
table
(
tbody
,@
header
))))
(
tr
(
td
(
table
(
tbody
,@
body
))))
,@
footer
)
`
((
tr
(
td
(
table
(
tbody
,@
header
))))
(
tr
(
td
(
table
(
tbody
,@
body
))))
(
tr
(
td
(
table
(
tbody
,@
footer
))))))))
;; header + body
(
if
(
=
nheader
nbody
)
`
((
tr
(
td
(
table
(
tbody
,@
header
,@
body
)))))
(
if
(
=
nheader
1
)
`
(
,@
header
(
tr
(
td
(
table
(
tbody
,@
body
)))))
`
((
tr
(
td
(
table
(
tbody
,@
header
))))
(
tr
(
td
(
table
(
tbody
,@
body
))))))))
(
if
footer
;; body + footer
(
if
(
=
nbody
nfooter
)
`
((
tr
(
td
(
table
(
tbody
,@
body
,@
footer
)))))
(
if
(
=
nfooter
1
)
`
((
tr
(
td
(
table
(
tbody
,@
body
))))
,@
footer
)
`
((
tr
(
td
(
table
(
tbody
,@
body
))))
(
tr
(
td
(
table
(
tbody
,@
footer
)))))))
body
))))))
(
defun
shr-find-elements
(
cont
type
)
(
let
(
result
)
(
dolist
(
elem
cont
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment