1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use Debug;
use crateParser;
/// An `SvgFileHandler` is responsible for providing the raw contents of an SVG
/// file when an inline image macro requests that the SVG be embedded directly
/// in the output (`image:target.svg[opts=inline]`).
///
/// This crate is a parser, not a converter, and never reads from the
/// filesystem itself. A client of [`Parser`] that wants inline SVG images to be
/// embedded must provide an `SvgFileHandler` (analogous to
/// [`IncludeFileHandler`] and [`DocinfoFileHandler`]) that maps a resolved
/// image path to its content. If no handler is provided (or the handler cannot
/// find the file), the inline SVG image degrades to a `<span class="alt">`
/// element containing the alt text, matching Ruby Asciidoctor's behavior when
/// the SVG contents can't be read.
///
/// [`Parser`]: crate::Parser
/// [`IncludeFileHandler`]: crate::parser::IncludeFileHandler
/// [`DocinfoFileHandler`]: crate::parser::DocinfoFileHandler