This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
|
dokuwiki_add_caption [2021/06/07 23:35] admin ↷ draft:dokuwiki_add_caption から dokuwiki_add_caption へページを移動しました。 |
dokuwiki_add_caption [2021/06/09 22:41] admin [Mechanism] |
||
|---|---|---|---|
| Line 16: | Line 16: | ||
| let $prevDiv = $table.parent().prev(); | let $prevDiv = $table.parent().prev(); | ||
| if ($prevDiv.hasClass(' | if ($prevDiv.hasClass(' | ||
| - | | + | |
| - | $table.prepend(captionHtml); | + | let captionText = $prevDiv.children(' |
| - | | + | $table.prepend('< |
| + | $prevDiv.remove(); | ||
| + | | ||
| + | location.href = location.hash; | ||
| + | } | ||
| + | } | ||
| } | } | ||
| }); | }); | ||
| Line 87: | Line 92: | ||
| | 3 | Scelerisque vestibulum metus risus |25 | | | 3 | Scelerisque vestibulum metus risus |25 | | ||
| | 4 | Nunc a commodo nullam | 200 | | | 4 | Nunc a commodo nullam | 200 | | ||
| + | |||
| + | ===== Mechanism ===== | ||
| + | |||
| + | The original HTML text is: | ||
| + | |||
| + | <code html> | ||
| + | <div class=" | ||
| + | <p> Caption text</ | ||
| + | </ | ||
| + | <div class=" | ||
| + | < | ||
| + | ... | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | This is transformed to: | ||
| + | |||
| + | <code html> | ||
| + | <div class=" | ||
| + | < | ||
| + | < | ||
| + | ... | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| + | Since this transformation is made **after** the rendering by DokuWiki, the normal formatting syntax (such as '' | ||
| + | |||