8000 Respect image external attribute in epub writer by brisad · Pull Request #7430 · jgm/pandoc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Respect image external attribute in epub writer #7430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions MANUAL.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6177,6 +6177,12 @@ with the `src` attribute. For example:
</source>
</audio>

If the input format already is HTML then `data-external="1"` will work
as expected for `<img>` elements. Similarly, for Markdown, external
images can be declared with `![img](url){external=1}`. Note that this
only works for images; the other media elements have no native
representation in pandoc's AST and requires the use of raw HTML.

# Jupyter notebooks

When creating a [Jupyter notebook], pandoc will try to infer the
Expand Down
3 changes: 2 additions & 1 deletion src/Text/Pandoc/Writers/EPUB.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,8 @@ transformInline :: PandocMonad m
=> WriterOptions
-> Inline
-> E m Inline
transformInline _opts (Image attr lab (src,tit)) = do
transformInline _opts (Image attr@(_,_,kvs) lab (src,tit))
| isNothing (lookup "external" kvs) = do
newsrc <- modifyMediaRef $ T.unpack src
return $ Image attr lab ("../" <> newsrc, tit)
transformInline opts x@(Math t m)
Expand Down
0