Skip to content

pandoc should not download and include an external audio file in the EPUB output #2473

Closed
fedelibre opened this Issue · 3 comments

2 participants

@fedelibre

As emerged in this discussion, pandoc downloads and includes an audio file in the EPUB output file.

HTML output does not include external resources by default and you can include them with the option --self-contained. IMO epub output should work the same way.

Test file:

# Test

Testing the audio element from an external link:

<audio controls>
 <source src="http://www.sixbarsjail.it/tmp/bach_toccata.mp3" type="audio/mpeg">
</audio>

$ pandoc --version
pandoc 1.15.1.1

Command: pandoc -o output.epub inpub.md

@jgm
Owner

Suggestion from pandoc-discuss:

In principle we could change this behavior, but a change in
the default here might break existing workflows. One
possibility would be to make this behavior sensitive to some
kind of flag. For example, if the data-external attribute
is set on <source> element, don't include in the EPUB.

@fedelibre

Another thought: would it be possible to parse the link and check if it's a local path or an http:// link?
That way, it would work also when CommonMark will add the syntax to embed audio and video.

@jgm
Owner
@jgm jgm added a commit that closed this issue
@jgm EPUB writer: don't download linked media when `data-external` attribu…
…te set.

By default pandoc downloads all linked media and includes it in the
EPUB container.  This can be disabled by setting `data-external`
on the tags linking to media that should not be downloaded.

Example:

    <audio controls="1">
     <source src="http://www.sixbarsjail.it/tmp/bach_toccata.mp3"
     type="audio/mpeg"></source>
    </audio>

Closes #2473.
c80c0df
@jgm jgm closed this in c80c0df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.