Wrap table captions in div tags instead of caption

caption tags should not be used outside table tags -
https://www.w3schools.com/tags/tag_caption.asp

Because of the hugo/blackfriday limitation, we'll live with the table
caption staying in a plain div just before the table.
master
Kaushal Modi 8 years ago
parent fe2be15e55
commit 735d6d29ed
  1. 4
      ox-blackfriday.el
  2. 16
      test/site/content/posts/links-to-tables.md
  3. 12
      test/site/content/posts/table-caption.md

@ -682,10 +682,10 @@ contextual information."
table info
nil #'org-html--has-caption-p))
(caption-str (org-export-data caption info)))
(format (concat "<caption class=\"table-caption\">\n"
(format (concat "<div class=\"table-caption\">\n"
" <span class=\"table-number\">Table %d:</span>\n"
" %s\n"
"</caption>\n\n")
"</div>\n\n")
table-num caption-str))))
(tbl (replace-regexp-in-string "\n\n" "\n" contents)))
;; If the table has only 1 row, do *not* make it a header row..

@ -31,18 +31,18 @@ Here's another table:
will output below (_lorem-ipsum_ added to increase page content so
that the link jump is evident):
<a id="org44317dc"></a>
<a id="orgbae2c99"></a>
<caption class="table-caption">
<div class="table-caption">
<span class="table-number">Table 1:</span>
Simple table 1
</caption>
</div>
| a | b |
|---|---|
| c | d |
**Here we refer to table [2](#org0622dcf).**
**Here we refer to table [2](#orge7efcb1).**
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque et
quam metus. Etiam in iaculis mi, sit amet pretium magna. Donec ut dui
@ -98,18 +98,18 @@ blandit in.
Here's another table:
<a id="org0622dcf"></a>
<a id="orge7efcb1"></a>
<caption class="table-caption">
<div class="table-caption">
<span class="table-number">Table 2:</span>
Simple table 2
</caption>
</div>
| e | f |
|---|---|
| g | h |
**Here we refer to table [1](#org44317dc).**
**Here we refer to table [1](#orgbae2c99).**
---

@ -7,10 +7,10 @@ draft = false
The caption can contain be emphasized using the usual markup
characters too.
<caption class="table-caption">
<div class="table-caption">
<span class="table-number">Table 1:</span>
Awesome table
</caption>
</div>
| h1 | h2 | h3 |
|-----|-----|-----|
@ -18,10 +18,10 @@ characters too.
Some text.
<caption class="table-caption">
<div class="table-caption">
<span class="table-number">Table 2:</span>
_Another_ **awesome** table
</caption>
</div>
| h1 | h2 | h3 |
|-----|-----|-----|
@ -29,10 +29,10 @@ Some text.
Some more text.
<caption class="table-caption">
<div class="table-caption">
<span class="table-number">Table 3:</span>
<span class="underline">Third</span> table
</caption>
</div>
| h1 | h2 | h3 |
|-----|-----|----|

Loading…
Cancel
Save