@@ -84,7 +84,9 @@ Listing: Example listing
8484becomes
8585
8686``` html
87- <caption ><span >Listing  ; 1:</span > Example listing</caption >
87+ <div class =" listing" id =" _listing-1" >
88+ <figcaption ><span >Listing  ; 1:</span > Example listing</figcaption >
89+ </div >
8890```
8991
9092## How?
@@ -170,7 +172,7 @@ The default values for each type of content is synthesised in the following tabl
170172| ------------------------| ---------| ---------| -----------|
171173| ` caption_prefix ` | "Image" | "Table" | "Listing" |
172174| ` numbering ` | False | False | False |
173- | ` content_class ` | - | - | - |
175+ | ` content_class ` | - | - | listing |
174176| ` caption_class ` | - | - | - |
175177| ` caption_prefix_class ` | - | - | - |
176178| ` caption_top ` | False | True | True |
@@ -224,6 +226,67 @@ figcaption span:first-child {
224226```
225227 There are further examples in the [ wiki] ( https://github.com/flywire/caption/wiki ) .
226228
229+ ## Compatibility with attr_list extension
230+
231+ * caption* supports preserving ` attr_list ` extension supplied ` id ` and ` class ` attributes by:
232+
233+ * giving priority to markdown defined ` id ` attributes
234+ * concatenating ` class ` attributes.
235+
236+ ### ` image_captions `
237+
238+ This samples shows how to create a captioned image with ` id ` and ` class ` through markdown ` attr_list ` extension.
239+
240+ ``` markdown
241+ ![ Alt text] ( /path/to/image.png " This is the title of the image. ") { #title-image .test-class }
242+ ```
243+
244+ becomes
245+
246+ ``` html
247+ <figure id =" _figure-1" >
248+ <img alt =" Alt text" src =" /path/to/image.png" id =" title-image" class =" test-class" />
249+ ...
250+ ```
251+
252+ ### ` table_captions `
253+
254+ This samples shows how to create a captioned table with ` id ` and ` class ` through markdown ` attr_list ` extension.
255+
256+ ``` markdown
257+ Table: Example with heading, two columns and a row
258+ {#example-with-heading .test-class}
259+
260+ | Syntax | Description |
261+ | ----------- | ----------- |
262+ | Header | Title |
263+ ```
264+
265+ becomes
266+
267+ ``` html
268+ <table id =" example-with-heading" class =" test-class table" >
269+ ...
270+ ```
271+
272+ ### ` caption `
273+
274+ This samples shows how to create a generic caption with ` id ` and ` class ` through markdown ` attr_list ` extension.
275+
276+
277+ ``` markdown
278+ Listing: Example listing
279+ { #example-listing .test-class }
280+ ```
281+
282+ becomes
283+
284+ ``` html
285+ <div class =" listing test-class" id =" example-listing" >
286+ <figcaption ><span >Listing  ; 1:</span > Example listing</figcaption >
287+ </div >
288+ ```
289+
227290## Customisable
228291
229292If the settings aren't flexible enough the source code can be changed and
0 commit comments