aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-09-08Logging: add NotUTF8Encoded constructor to LogMessage.John MacFarlane1-0/+7
[API change]
2021-09-08CI: disable ansi-tricks in tasty.John MacFarlane1-6/+6
This will prevent the test output from being overwhelmed with headings from passing tests.
2021-09-08Makefile: disable ansi tricks for tasty; use v2- instead of new-.John MacFarlane1-9/+9
2021-09-04Rephrase pandoc.path docs (#7548)Quinn1-2/+2
2021-09-04RTF reader: better handling of `\*` and bookmarks.John MacFarlane2-9/+9
We now ensure that groups starting with `\*` never cause text to be added to the document. In addition, bookmarks now create a span between the start and end of the bookmark, rather than an empty span.
2021-09-04Minor renaming to avoid shadowing.John MacFarlane1-2/+2
2021-09-04Extensions: put Ext_short_subsuperscripts in alphabetical order.John MacFarlane1-1/+1
2021-09-04Improve order of Image fieldsQuinn1-3/+3
Ensure consistency throughout docs
2021-09-04Add missing type for Image titleQuinn1-1/+1
2021-09-03RTF reader: if doc begins with {\rtf1 ... } only parse its contents.John MacFarlane1-1/+7
Some documents seem to have non-RTF (e.g. XML) material after the `{\rtf1 ... }` group.
2021-09-03RTF reader: Ignore `\pgdsc` group.John MacFarlane1-0/+1
Otherwise we get style names treated as test.
2021-09-01pptx: Add support for more layoutsEmily Bourke91-68/+580
Until now, the pptx writer only supported four slide layouts: “Title Slide” (used for the automatically generated metadata slide), “Section Header” (used for headings above the slide level), “Two Column” (used when there’s a columns div containing at least two column divs), and “Title and Content” (used for all other slides). This commit adds support for three more layouts: Comparison, Content with Caption, and Blank. - Support “Comparison” slide layout This layout is used when a slide contains at least two columns, at least one of which contains some text followed by some non-text (e.g. an image or table). The text in each column is inserted into the “body” placeholder for that column, and the non-text is inserted into the ObjType placeholder. Any extra content after the non-text is overlaid on top of the preceding content, rather than dropping it completely (as currently happens for the two-column layout). + Accept straightforward test changes Adding the new layout means the “-deleted-layouts” tests have an additional layout added to the master and master rels. + Add new tests for the comparison layout + Add new tests to pandoc.cabal - Support “Content with Caption” slide layout This layout is used when a slide’s body contains some text, followed by non-text (e.g. and image or a table). Before now, in this case the image or table would break onto a new slide: to get that output again, users can add a horizontal rule before the image or table. + Accept straightforward tests The “-deleted-layouts” tests all have an extra layout and relationship in the master for the Content with Caption layout. + Accept remove-empty-slides test Empty slides are still removed, but the Content with Caption layout is now used. + Change slide-level-0/h1-h2-with-text description This test now triggers the content with caption layout, giving a different (but still correct) result. + Add new tests for the new layout + Add new tests to the cabal file - Support “Blank” slide layout This layout is used when a slide contains only blank content (e.g. non-breaking spaces). No content is inserted into any placeholders in the layout. Fixes #5097. + Accept straightforward test changes Blank layout now copied over from reference doc as well, when layouts have been deleted. + Add some new tests A slide should use the blank layout if: - It contains only speaker notes - It contains only an empty heading with a body of nbsps - It contains only a heading containing only nbsps - Change ContentType -> Placeholder This type was starting to have a constructor for each placeholder on each slide (e.g. `ComparisonUpperLeftContent`). I’ve changed it instead to identify a placeholder by type and index, as I think that’s clearer and less redundant. - Describe layout-choosing logic in manual
2021-09-01pptx: Restructure testsEmily Bourke126-58/+111
- Use dashes consistently rather than underscores - Make a folder for each set of tests - List test files explicitly (Cabal doesn’t support ** until version 2.4)
2021-08-30Hlint: ignore "Use void."John MacFarlane1-0/+1
2021-08-30Do not leak working directory in TikZ filterJeroen de Haas1-3/+3
2021-08-29Improve asciidoc escaping for `--` in URLs. Closes #7529.John MacFarlane2-3/+18
2021-08-28Add more potential threats to security section of manual.John MacFarlane1-3/+11
2021-08-28Add `--sandbox` option.John MacFarlane9-85/+120
+ Add sandbox feature for readers. When this option is used, readers and writers only have access to input files (and other files specified directly on command line). This restriction is enforced in the type system. + Filters, PDF production, custom writers are unaffected. This feature only insulates the actual readers and writers, not the pipeline around them in Text.Pandoc.App. + Note that when `--sandboxed` is specified, readers won't have access to the resource path, nor will anything have access to the user data directory. + Add module Text.Pandoc.Class.Sandbox, defining `sandbox`. Exported via Text.Pandoc.Class. [API change] Closes #5045.
2021-08-28Remove unneeded import.John MacFarlane1-1/+1
2021-08-28Docx writer: handle SVG images.John MacFarlane2-6/+56
This change has several parts: - In Text.Pandoc.App, if the writer is docx, we fill the media bag and attempt to convert any SVG images to PNG, adding these to the media bag. The PNG backups have the same filenames as the SVG images, but with an added .png extension. If the conversion cannot be done (e.g. because rsvg-convert is not present), a warning is omitted. - In Text.Pandoc.Writers.Docx, we now use Word 2016's syntax for including SVG images. If a PNG fallback is present in the media bag, we include a link to that too. It would be helpful if someone with an old Word version could test to see that the documents we produce can be opened and viewed with the PNG fallbacks. If not, then perhaps we can eliminate the slightly complex code for producing these fallbacks. Closes #4058.
2021-08-27Image: Generalize svgToPng to MonadIO.John MacFarlane1-4/+5
2021-08-27Add haddock for dpi parameter.John MacFarlane1-1/+1
2021-08-27T.P.Image: svgToPng, change first parameter from WriterOptions to Int.John MacFarlane1-4/+4
The information we need is just a DPI, so why require more?
2021-08-27pptx: Make first heading title if slide level is 0Emily Bourke22-24/+85
Before this commit, the pptx writer adds a slide break before any table, “columns” div, or paragraph starting with an image, unless the only thing before it on the same slide is a heading at the slide level. In that case, the item and heading are kept on the same slide, and the heading is used as the slide title (inserted into the layout’s “title” placeholder). However, if the slide level is set to 0 (as was recently enabled) this makes it impossible to have a slide with a title which contains any of those items in its body. This commit changes this behaviour: now if the slide level is 0, then items will be kept with a heading of any level, if the heading’s the only thing before the item on the same slide.
2021-08-27Ensure we have unique ids for wp:docPr and pic:cNvPr elements.John MacFarlane3-9/+11
This will, I hope, fix #7527 and #7503.
2021-08-27Clarify 'attributes' extension supportWilliam Lupton1-1/+2
2021-08-24Comment out unused module.John MacFarlane1-1/+1
2021-08-24Reorganize App to make it easier to limit IO in main loop.John MacFarlane1-85/+100
Previously we used liftIO fairly liberally. The code has been restructured to avoid this. A small behavior change is that pandoc will now fall back to latin1 encoding for inputs that can't be read as UTF-8. This is what it did previously for content fetched from the web and not marked as to content type. It makes sense to do the same for local files.
2021-08-24Text.Pandoc.Class: add readStdinStrict method to PandocMonad.John MacFarlane5-0/+17
[API change]
2021-08-24Class: Generalize type of extractMedia.John MacFarlane1-1/+1
It was uselessly restricted to PandocIO, instead of any instance of PandocMonad and MonadIO. [API change]
2021-08-24T.P.App.OutputSettings: Generalize some types...John MacFarlane2-7/+6
so we can run this with any instance of PandocMonad and MonadIO, not just PandocIO.
2021-08-24Text.Pandoc.Filter: Generalize type of applyFilters...John MacFarlane3-9/+91
from PandocIO to any instance of MonadIO and PandocMonad. [API change]
2021-08-24PDF: generalize type of makePDF...John MacFarlane1-40/+55
instead of PandocIO, it can be used in any instance of PandocMonad, MonadIO, and MonadMask. [API change]
2021-08-24Lua subsystem and custom writers: generalize types from PandocIO...John MacFarlane3-8/+8
to any instance of PandocMonad and MonadIO. This involves an API change, since the type of runLua is now (PandocMonad m, MonadIO m) => Lua a -> m (Either PandocError a)
2021-08-24Fix test for #7521.John MacFarlane1-2/+2
2021-08-23Markdown reader: fix interaction of --strip-comments and listJohn MacFarlane2-1/+12
parsing. Use of `--strip-comments` was causing tight lists to be rendered as loose (as if the comment were a blank line). Closes #7521.
2021-08-22Clean up PDF module.John MacFarlane1-59/+49
Previously we had to run runIOorExplode inside withTempDir. Now that PandocIO is an instance of MonadMask, this is no longer necessary.
2021-08-22PandocIO: derive MonadCatch, MonadThrow, MonadMask.John MacFarlane1-0/+4
This will allow us to use withTempDir.
2021-08-22MANUAL: document error code 25John MacFarlane1-0/+1
2021-08-22App: Move output-file writing out of PandocMonad action.John MacFarlane1-29/+29
2021-08-22Add some more info regarding `--slide-level=0`Salim B1-8/+9
2021-08-22Harmonize spelling of 'slide show'Salim B1-4/+4
2021-08-21LaTeX-parser: restrict \endinput to current fileSimon Schuster5-1/+27
2021-08-21Regenerate README.md.John MacFarlane1-0/+2
2021-08-20Add note to changelog.John MacFarlane1-0/+2
2021-08-20Fix typo in changelog.John MacFarlane1-1/+1
2021-08-20Update manual date and man page.John MacFarlane2-18/+89
2021-08-20Bump to 2.14.2, update changelog.John MacFarlane2-14/+20
2021-08-20MANUAL.txt/security: add a note on security risks of include directives.John MacFarlane1-3/+8
2021-08-20RST reader: Fix `:literal:` includes.John MacFarlane2-6/+3
These should create code blocks, not insert raw RST. Closes #7513.