aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/SelfContained.hs
AgeCommit message (Collapse)AuthorFilesLines
2015-06-28Fixed regression in CSS parsing with `--self-contained`.John MacFarlane1-39/+47
In 1b44acf0c59b70cc63f48a23c6f77e45a982aaf9 we replaced some hackish CSS parsing with css-text, which I thought was a complete CSS parser. It turns out that it is very buggy, which results in lots of things being silently dropped from CSS when `--self-contained` is used (#2224). This commit replaces the use of css-text with a small but more principled css preprocessor, which only removes whitespace and replaces URLs with base 64 data when possible. Closes #2224.
2015-05-04SelfContained: properly handle data URIs in css urls.John MacFarlane1-32/+48
Also use a proper css parser (adds dependency on text-css). Closes #2129.
2015-05-01SelfContained: cssURLs no longer tries to fetch fragment URLs.John MacFarlane1-7/+11
The current test is: does the URL start with a `#`? Closes #2121.
2015-04-26Updated copyright notices to -2015. Closes #2111.John MacFarlane1-2/+2
2015-02-13Improved building of data URIs in SelfContained.John MacFarlane1-8/+15
Now base64 is used except for 'text/*' mime types. Closes #1940.
2014-12-31SelfContained: Add `;charset=utf-8` to script mime type if missing.John MacFarlane1-1/+4
Closes #1842.
2014-10-04Added `track` to list of tags treated by `--self-contained`.John MacFarlane1-1/+2
Closes #1664.
2014-08-17MIME cleanup.Artyom Kazak1-2/+3
* 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-08-02SelfContained: Fixed determining of source URL from within CSS files.John MacFarlane1-2/+9
(This fixes a bug introduced a couple commits back.)
2014-08-02Text.Pandoc.SelfContained changes.John MacFarlane1-57/+27
* mkSelfContained now takes just two arguments, WriterOptions and the string. * It no longer looks in data files. This only made sense when we had copies of slidy and S5 code there. * Shared.fetchItem' is used instead of the nearly duplicate getItem.
2014-07-31New module, Text.Pandoc.MediaBag.John MacFarlane1-2/+2
Moved `MediaBag` definition and functions from Shared: `lookupMedia`, `mediaDirectory`, `insertMedia`, `extractMediaBag`. Removed `emptyMediaBag`; use `mempty` instead, since `MediaBag` is a Monoid.
2014-07-31Made MediaBag a newtype, and added mime type information to media.John MacFarlane1-11/+15
Shared now exports functions for interacting with a MediaBag: - `emptyMediaBag` - `lookuMedia` - `insertMedia` - `mediaDirectory` - `extractMediaBag`
2014-07-30Allow --self-contained to get content from MediaBag.John MacFarlane1-25/+34
Added a parameter to makeSelfContained (API change).
2014-05-09Update copyright notices for 2014, add missing noticesAlbert Krewinkel1-2/+2
2014-03-05SelfContained: Handle "poster" attribute in "video" tags.John MacFarlane1-8/+10
Closes #1188.
2013-10-16Use isURI instead of isAbsoluteURI.John MacFarlane1-3/+3
It allows fragments identifiers.
2013-07-18Improved fetching of external resources.John MacFarlane1-2/+3
* In Shared, openURL and fetchItem now return an Either, for better error handling. (API change.) * Better error message when fetching a URL fails with `--self-contained`. * EPUB writer: If resource not found, skip it, as in Docx writer. * Closes #916.
2013-04-10Added comment/todo to SelfContained.John MacFarlane1-0/+1
2013-03-26SelfContained: handle src in embed, audio, source, input tags.John MacFarlane1-9/+4
2013-03-25SelfContained: strip off fragment, query of relative URLJohn MacFarlane1-4/+8
before treating as a filename. This fixes `--self-contained` when used with CSS files that include web fonts using the method described here: http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/ Examples from reveal.js themes: "../../lib/font/league_gothic-webfont.eot?#iefix" "../../lib/font/league_gothic-webfont.svg#LeagueGothicRegular" Closes #739.
2013-01-11Refactoring:John MacFarlane1-2/+16
* Shared now exports fetchItem (instead of getItem) and openURL * fetchItem has different parameters than getItem and includes some logic formerly in the ODT and Docx writers * getItem still used in SelfContained
2013-01-11Move getItem from SelfContained to Share; export getItem.John MacFarlane1-28/+3
2012-12-29Data files changes.John MacFarlane1-13/+3
* Added `embed_data_files` flag. (not yet used) * Shared no longer exports `findDataFile`. * `readDataFile` now returns a strict bytestring. * Shared now exports `readDataFileUTF8` which returns a string like the old `readDataFile`. * Rewrote modules to use new data file functions and to avoid using functions from Paths_pandoc directly.
2012-09-25Removed need for utf8-string package.John MacFarlane1-1/+1
* Depend on text. * Expose Text.Pandoc.UTF8. * Text.Pandoc.UTF8 now exports toString, fromString, toStringLazy, fromStringLazy. * These are used instead of the old utf8-string functions.
2012-08-15Moved renderTags' from HTML reader & SelfContained to Shared.John MacFarlane1-12/+1
Improved removal of markdown="1" attribute in Markdow reader.
2012-07-26Fixed whitespace errors.John MacFarlane1-2/+2
2012-06-28SelfContained: Fix handling of absolute URLs in css imports.John MacFarlane1-1/+5
Also allow single-quoted values. Closes #535.
2012-02-17Don't escape `<` in `<style>` tags with `--self-contained`.John MacFarlane1-2/+12
Closes #422: highlighting lost using `--self-contained`.
2012-01-14SelfContained: Use getMimeType from Text.Pandoc.MIME.John MacFarlane1-135/+6
2011-12-04SelfContained: Get mime type from HTTP request if possible.John MacFarlane1-18/+30
--webtex --self-contained now works.
2011-12-04SelfContained: Convert all url()s in css to data: uris.John MacFarlane1-29/+22
2011-11-24--self-contained now works with `<video>` as well as `<img>`.John MacFarlane1-0/+7
2011-11-21Changed Offline module to SelfContained, offline to makeSelfContained.John MacFarlane1-0/+279