Require nonempty alt text for implicit_figures
.
A figure with an empty caption doesn't make sense. Closes #2844.
This commit is contained in:
parent
33a29fbf87
commit
7d9d77ca44
2 changed files with 9 additions and 9 deletions
15
MANUAL.txt
15
MANUAL.txt
|
@ -3227,17 +3227,16 @@ The link text will be used as the image's alt text:
|
|||
|
||||
#### Extension: `implicit_figures` ####
|
||||
|
||||
An image occurring by itself in a paragraph will be rendered as
|
||||
a figure with a caption.[^5] (In LaTeX, a figure environment will be
|
||||
used; in HTML, the image will be placed in a `div` with class
|
||||
`figure`, together with a caption in a `p` with class `caption`.)
|
||||
The image's alt text will be used as the caption.
|
||||
An image with nonempty alt text, occurring by itself in a
|
||||
paragraph, will be rendered as a figure with a caption. The
|
||||
image's alt text will be used as the caption.
|
||||
|
||||
![This is the caption](/url/of/image.png)
|
||||
|
||||
[^5]: This feature is not yet implemented for RTF, OpenDocument, or
|
||||
ODT. In those formats, you'll just get an image in a paragraph by
|
||||
itself, with no caption.
|
||||
How this is rendered depends on the output format. Some output
|
||||
formats (e.g. RTF) do not yet support figures. In those
|
||||
formats, you'll just get an image in a paragraph by itself, with
|
||||
no caption.
|
||||
|
||||
If you just want a regular inline image, just make sure it is not
|
||||
the only thing in the paragraph. One way to do this is to insert a
|
||||
|
|
|
@ -1035,7 +1035,8 @@ para = try $ do
|
|||
result' <- result
|
||||
case B.toList result' of
|
||||
[Image attr alt (src,tit)]
|
||||
| Ext_implicit_figures `extensionEnabled` exts ->
|
||||
| not (null alt) &&
|
||||
Ext_implicit_figures `extensionEnabled` exts ->
|
||||
-- the fig: at beginning of title indicates a figure
|
||||
return $ B.para $ B.singleton
|
||||
$ Image attr alt (src,'f':'i':'g':':':tit)
|
||||
|
|
Loading…
Add table
Reference in a new issue