summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/MIME.hs
AgeCommit message (Collapse)Author
2023-11-17Ensure we use .svg not .svgz as extension for image/svg+xml mime type.John MacFarlane
See #9195.
2023-01-10Update copyright years, it's 2023!Albert Krewinkel
2022-09-12T.P.MIME: Removes more unnecessary overrides.Albert Krewinkel
| Ext. | Old type | New type | |-------|--------------------------|---------------------------------| | fm | application/x-maker | application/vnd.framemaker | | frame | application/x-maker | application/vnd.framemaker | | gsf | application/x-font | application/x-font-ghostscript | | java | text/x-java | text/x-java-source | | kpr | application/x-kpresenter | application/vnd.kde.kpresenter | | kpt | application/x-kpresenter | application/vnd.kde.kpresenter | | ksp | application/x-kspread | application/vnd.kde.kspread | | kwd | application/x-kword | application/vnd.kde.kword | | kwt | application/x-kword | application/vnd.kde.kword | | lha | application/x-lha | application/x-lzh-compressed | | lhz | application/x-lhz | application/x-lzh-compressed | | maker | application/x-maker | application/vnd.framemaker | | mif | application/x-mif | application/vnd.mif | | pl | text/x-perl | application/x-perl | | pm | text/x-perl | application/x-perl | | sisx | x-epoc/x-sisx-app | application/vnd.symbian.install | | sitx | application/x-stuffit | application/x-stuffitx | | skd | application/x-koan | application/vnd.koan | | skm | application/x-koan | application/vnd.koan | | skp | application/x-koan | application/vnd.koan | | skt | application/x-koan | application/vnd.koan | | tgz | application/x-gtar | application/x-tgz | | tk | text/x-tcl | application/x-tcl | | wpd | application/wordperfect | application/vnd.wordperfect |
2022-09-11T.P.MIME: Remove deprecated overrides (#8292)Albert Krewinkel
This changes the media type that's used for the file extension listed below. The new types are either IANA approved, or so similar to the override that is does not seem sensible to keep a separate entry.
2022-09-11Require mime-types 0.1.1Albert Krewinkel
This version has an updated list of media types, which renders some overrides redundant.
2022-09-04T.P.Mime: Base module on package mime-types. (#8277)Albert Krewinkel
The *mime-types* module is a dependency of *http-client* and therefore already a transitive dependency of pandoc.
2022-06-21Update fonts MIME following IANA recommendation (#8127)Gabriel Lewertowski
2022-03-30Add mime type for mkv extension (#7181).John MacFarlane
2022-01-02Copyright notices: update for 2022Albert Krewinkel
2021-07-22MIME: use image/x-xcf instead of application/x-xcf.John MacFarlane
Closes #7454.
2021-06-10T.P.MIME, extensionFromMimeType: add a few special cases.John MacFarlane
When we do a reverse lookup in the MIME table, we just get the last match, so when the same mime type is associated with several different extensions, we sometimes got weird results, e.g. `.vs` for `text/plain`. These special cases help us get the most standard extensions for mime types like `text/plain`.
2021-02-22Text.Pandoc.MIME: add exported function getCharset.John MacFarlane
[API change]
2021-01-08Update copyright notices for 2021 (#7012)Albert Krewinkel
2020-06-17Fix MIME type for TrueType fonts in EPUBs (#6464)Michael Reed
Per the EPUB 3.2 spec, "application/x-font-truetype" is no longer a valid identifier for TrueType (.ttf) fonts [1]. This fixes warnings when validating pandoc-generated EPUBs using `epubcheck` [2]. References [3]. [1]: https://www.w3.org/publishing/epub3/epub-spec.html#sec-core-media-types [2]: https://github.com/w3c/epubcheck
2020-03-15Use implicit Prelude (#6187)Albert Krewinkel
* Use implicit Prelude The previous behavior was introduced as a fix for #4464. It seems that this change alone did not fix the issue, and `stack ghci` and `cabal repl` only work with GHC 8.4.1 or newer, as no custom Prelude is loaded for these versions. Given this, it seems cleaner to revert to the implicit Prelude. * PandocMonad: remove outdated check for base version Only base versions 4.9 and later are supported, the check for `MIN_VERSION_base(4,8,0)` is therefore unnecessary. * Always use custom prelude Previously, the custom prelude was used only with older GHC versions, as a workaround for problems with ghci. The ghci problems are resolved by replacing package `base` with `base-noprelude`, allowing for consistent use of the custom prelude across all GHC versions.
2020-03-13Update copyright year (#6186)Albert Krewinkel
* Update copyright year * Copyright: add notes for Lua and Jira modules
2020-02-07More in-depth refactoring and cleanup (#6123)Joseph C. Sible
* Avoid duplicating the dash case * Pull common functions out of case branches * Make sure list lengths are only calculated once * Use unless * Simplify parseURIReference' and avoid an unnecessary call to length * Use <$> instead of reimplementing it * Use swap instead of reimplementing it * Remove eta-expansion that's been unnecessary since 90f5dd8 * Use tailDef instead of reimplementing it * Use second instead of fmap, per @tarleb
2019-12-20Added glsl mime type for WebGL maps (#6000)Jared Lander
Added glsl mime type for WebGL maps
2019-12-12Change misleading module comment.John MacFarlane
2019-11-12Switch to new pandoc-types and use Text instead of String [API change].despresc
PR #5884. + Use pandoc-types 1.20 and texmath 0.12. + Text is now used instead of String, with a few exceptions. + In the MediaBag module, some of the types using Strings were switched to use FilePath instead (not Text). + In the Parsing module, new parsers `manyChar`, `many1Char`, `manyTillChar`, `many1TillChar`, `many1Till`, `manyUntil`, `mantyUntilChar` have been added: these are like their unsuffixed counterparts but pack some or all of their output. + `glob` in Text.Pandoc.Class still takes String since it seems to be intended as an interface to Glob, which uses strings. It seems to be used only once in the package, in the EPUB writer, so that is not hard to change.
2019-05-29HTML writer: output video and audio elementsmb21
depending on file extension of the image path
2019-05-29Text.Pandoc.MIME: add mediaCategory [API change]mb21
2019-03-01Remove license boilerplate.John MacFarlane
The haddock module header contains essentially the same information, so the boilerplate is redundant and just one more thing to get out of sync.
2019-02-04Add missing copyright notices and remove license boilerplate (#5112)Albert Krewinkel
Quite a few modules were missing copyright notices. This commit adds copyright notices everywhere via haddock module headers. The old license boilerplate comment is redundant with this and has been removed. Update copyright years to 2019. Closes #4592.
2019-02-02MIME: add WebPMauro Bieg
fixes #5267
2018-04-21Mime: Use the alias application/eps for eps.John MacFarlane
Instead of application/postscript. This will ensure that we retain the eps extension after reading the image into a mediabag and writing it again. See #2067.
2018-03-18Use NoImplicitPrelude and explicitly import Prelude.John MacFarlane
This seems to be necessary if we are to use our custom Prelude with ghci. Closes #4464.
2018-01-05Update copyright notices to include 2018Albert Krewinkel
2017-12-26Add opus to MIME type table as audio/ogg.John MacFarlane
See #4198.
2017-10-27hlint suggestions.John MacFarlane
2017-05-13Update dates in copyright noticesAlbert Krewinkel
This follows the suggestions given by the FSF for GPL licensed software. <https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>
2017-03-04Stylish-haskell automatic formatting changes.John MacFarlane
2017-02-24SelfContained: don't use data URIs for script or style.John MacFarlane
Instead, just use script or style tags with the content inside. The old method with data URIs prevents certain optimizations outside pandoc. Exception: data URIs are still used when a script contains `</script>` or a style contains `</`. Closes #3423. Also, in MIME, use application/javascript (not application/x-javascript).
2017-02-22Added emf to mimeTypes with type application/x-msmetafile.John MacFarlane
See #1713.
2016-11-12Use correct mime types for woff and woff2.John MacFarlane
Closes #3228.
2016-03-22Updated copyright dates to include 2016.John MacFarlane
2015-11-09Revert "Use -XNoImplicitPrelude and 'import Prelude' explicitly."John MacFarlane
This reverts commit c423dbb5a34c2d1195020e0f0ca3aae883d0749b.
2015-11-08Use -XNoImplicitPrelude and 'import Prelude' explicitly.John MacFarlane
This is needed for ghci to work with pandoc, given that we now use a custom prelude. Closes #2503.
2015-05-27Fixed svg handling in EPUB writer.John MacFarlane
This is a crude workaroud for #2183. A correct fix would require having openURL and fetchItem return a content encoding as well as a content type.
2015-04-29Added woff2 to MIME typesAlfred Wechselberger
2015-04-26Updated copyright notices to -2015. Closes #2111.John MacFarlane
2014-11-16Changed mime type for otf to application/vnd.ms-opentype.John MacFarlane
Closes #1761. This is needed for epub3 validation. See http://www.idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.3.1
2014-10-04add mime type for WebVTTJason Ronallo
2014-08-17MIME cleanup.Artyom Kazak
* Create a type synonym for MIME type (instead of `String`). * Add `getMimeTypeDef` function. * Avoid recreating MIME type `Map`s every time. * Move “Formula-...” case handling into `getMimeType`.
2014-05-09Update copyright notices for 2014, add missing noticesAlbert Krewinkel
2014-03-14EPUB writer: Incorporate files linked in <video> tags.John MacFarlane
src and poster will both be incorporated into content.opf and the epub container. This partially address #1170. Still need to do something similar for <audio>.
2014-01-07Added wmf and emf mime types.John MacFarlane
2013-11-30MIME: Add entry for jfif.John MacFarlane
2013-11-19MIME: In looking up extensions, drop the encoding info.John MacFarlane
E.g. for 'image/jpg;base64' we should lookup 'image/jpg'.
2013-07-20PDF generation improvements.John MacFarlane
* `Text.Pandoc.PDF` exports `makePDF` instead of `tex2pdf`. (API change.) * `makePDF` walks the pandoc AST and checks for the existence of images in the local directory. If they are not found, it attempts to find them, either in the directory containing the first source file, or at an absolute URL, or at a URL relative to the base URL of the first command line argument. * Closes #917.