aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
AgeCommit message (Collapse)AuthorFilesLines
2019-02-07Docx reader: Some code cleanupJesse Rosenthal1-15/+25
* clarify function name. We had previously used `getDocumentPath`, but `Document` is an overdetermined term here. Use `getDocumentXmlPath` to make clear what we're doing. * Use field notation for setting ReaderEnv. As we've added (and continue to add) fields, the assignment by position has gotten harder to read. * figure out document.xml path once at the beginning of parsing, and add it to the environment, so we can avoid repeated lookups.
2019-02-07Docx reader: Extend dynamic xml location to detecting relationshipsJesse Rosenthal1-12/+19
Getting the location used to depend on a hard-coded .rels file based on "word/document.xml". We now dynamically detect that file based on the document.xml file specified in "_rels/.rels"
2019-02-06Docx reader: Dynamically determine document.xml path.Jesse Rosenthal1-3/+12
The desktop Word program places the main document file in "word/document.xml", but the online word places it in "word/document2.xml". This file path is actually stated in the root "_rels/.rels" file, in the "Relationship" element with an "http://../officedocument" type. Closes #5277
2019-02-06Handle Word files generated by Microsoft Word Online.John MacFarlane1-0/+2
For some reason, Word in Office 365 Online uses `document2.xml` for the content, instead of `document.xml`. This causes pandoc not to be able to parse docx. This quick fix has the parser check for both `document.xml` and `document2.xml`. Addresses #5277, but a more robust solution would be to get the name of the main document dynamically (who knows whether it might change again?).
2019-02-04Add missing copyright notices and remove license boilerplate (#5112)Albert Krewinkel121-238/+298
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-04More carefully groom ipynb default extensions.John MacFarlane1-2/+18
2019-02-04Add `all_symbols_escapable` to githubMarkdownExtensions.John MacFarlane1-1/+1
2019-02-04Markdown reader: add newline when parsing blocks in YAML.John MacFarlane1-9/+10
Otherwise last block gets parsed as a Plain rather than a Para. This is a regression in pandoc 2.x. This patch restores pandoc 1.19 behavior. Closes #5271.
2019-02-02ipynb reader: handle images referring to attachments.John MacFarlane1-1/+9
Previously we didn't strip off the attachment: prefix, so even though the attachment is available in the mediabag, pandoc couldn't find it.
2019-02-02HTML5 writer: implement WAI-ARIA roles for (end)notes.John MacFarlane1-12/+25
See #4213.
2019-02-02Shared: withTempDir is no longer used in the codebase.John MacFarlane1-0/+2
Add comment to remove it in next major release.
2019-02-02PDF: More conservative solution to #777.John MacFarlane1-2/+11
Now, instead of always creating temp dirs in the home directory on Windows, we only do it if the system tempdir name contains tildes. (This will be the case for longer usernames only.) Closes #1192.
2019-02-02PDF: use system temp dir and set TEXMFOUTPUT.John MacFarlane1-8/+5
Previously the temp directory was created inside the working directory, so that programs like epstopdf.pl would be allowed to run in restricted mode. However, setting TEXMFOUTPUT allows these programs to run in the tmpdir inside the system temp directory. This is a better solution than cd51983. Using the system temp dir prevents problems when pandoc is run inside a synced directory (e.g. dropbox). Partially addresses #1192.
2019-02-02MIME: add WebPMauro Bieg1-0/+1
fixes #5267
2019-02-01LaTeX writer: use right fold for escapeString.John MacFarlane1-15/+13
This is more elegant than the explicit recursive we were using.
2019-02-01LaTeX writer: code simplification in escaping.John MacFarlane1-20/+21
2019-02-01Markdown writer: use markdown="1" when appropriate for Divs.John MacFarlane1-0/+6
When `native_divs` and `markdown_in_html_blocks` are disabled but `raw_html` and `markdown_attribute` are enabled...
2019-02-01LaTeX writer: avoid `{}` after control sequences when escaping.John MacFarlane1-26/+36
`\ldots{}.` doesn't behave as well as `\ldots.` with the latex ellipsis package. This patch causes pandoc to avoid emitting the `{}` when it is not necessary. Now `\ldots` and other control sequences used in escaping will be followed by either a `{}`, a space, or nothing, depending on context. Thanks to Elliott Slaughter for the suggestion.
2019-01-31LaTeX reader: don't let `\egroup` match `{`.John MacFarlane1-3/+3
`braced` now actually requires nested braces. Otherwise some legitimate command and environment definitions can break (see test/command/tex-group.md).
2019-01-30Update copyright year in version.John MacFarlane1-1/+1
2019-01-30Org reader: add support for #+SELECT_TAGS.leungbk4-23/+78
2019-01-30Org reader: separate filtering logic from conversion function.leungbk2-8/+11
2019-01-28Add cpp to avoid warning.John MacFarlane1-1/+6
2019-01-27Add isPrefixOf to imports.John MacFarlane1-1/+1
2019-01-26Improve writing metadata for docx, pptx and odt (#5252)Agustín Martín Barbero4-18/+99
* docx writer: support custom properties. Solves the writer part of #3024. Also supports additional core properties: `subject`, `lang`, `category`, `description`. * odt writer: improve standard properties, including the following core properties: `generator` (Pandoc/VERSION), `description`, `subject`, `keywords`, `initial-creator` (from authors), `creation-date` (actual creation date). Also fix date. * pptx writer: support custom properties. Also supports additional core properties: `subject`, `category`, `description`. * Includes golden tests. * MANUAL: document metadata support for docx, odt, pptx writers
2019-01-26Normalize Windows paths to account for change in ghc 8.6.John MacFarlane1-9/+31
When pandoc is compiled with ghc 8.6, Windows paths are treated differently, and paths beginning `\\server` no longer work. This commit rewrites such patsh to `\\?\UNC\server` which works. The change operates at the level of argument parsing, so it only affects the command line program. See #5127 and the discussion there.
2019-01-25Texinfo writer: use header identifier for anchor if present.John MacFarlane1-2/+4
Previously we were overwriting an existing identifier with a new one. Closes #4731.
2019-01-25MediaWiki reader: use `_` instead of `-` in auto-identifiers.John MacFarlane1-1/+6
Partially addresses #4731. We may not still be exactly matching mediawiki's algorithm for identifiers.
2019-01-25LaTeX writer: add `#` special characeters for listings.John MacFarlane1-1/+1
This character needs special handling in lstinline. Closes #4939.
2019-01-24Ipynb: Put all jupyter metadata under 'jupyter' key.John MacFarlane2-2/+7
2019-01-24Revert "Prepend `jupyter_` to jupyter metadata keys."John MacFarlane2-12/+0
This reverts commit 5eaff399d5d6dc30b0d453eff42c4101674d75ab.
2019-01-24Allow some command line options to take URL in addition to FILE.John MacFarlane1-2/+2
`--include-in-header`, `--include-before-body`, `--include-after-body`
2019-01-24Ms writer: ensure we have a newline after .EN in disply math.John MacFarlane1-1/+1
Closes #5251.
2019-01-24Prepend `jupyter_` to jupyter metadata keys.John MacFarlane2-0/+12
This avoids conflics with things like 'toc'.
2019-01-23Removed superfluous import.John MacFarlane1-1/+0
2019-01-22Support ipynb (Jupyter notebook) as input and output format.John MacFarlane8-0/+495
[API change] * Depend on ipynb library. * Add `ipynb` as input and output format. * Added Text.Pandoc.Readers.Ipynb (supports both nbformat v3 and v4). * Added Text.Pandoc.Writers.Ipynb (supports nbformat v4). * Added ipynb readers and writers to T.P.Readers, T.P.Writers, and T.P.Extensions. Register the file extension .ipynb for this format. * Add `PandocIpynbDecodingError` constructor to Text.Pandoc.Error.Error. * Note: there is no template for ipynb.
2019-01-22LaTeX reader: support `\endinput`. Closes #5233.John MacFarlane1-0/+1
2019-01-22Man reader: fix typo. (#5245)Brian Leung1-3/+3
2019-01-21HTML and markdown: treat textarea as a verbatim environment.John MacFarlane2-8/+10
We don't want to parse its contents as Markdown or HTML. Closes #5241.
2019-01-20LaTeX reader: allow includes with dots like cc_by_4.0.John MacFarlane1-3/+5
Previously the `.0` was interpreted as a file extension, leading pandoc not to add `.tex` (and thus not to find the file). The new behavior matches tex more closely.
2019-01-20LaTeX reader: cleaned up 'input' code.John MacFarlane1-10/+5
2019-01-17odt writer: fix typo in custom properties (#5231)Agustín Martín Barbero1-2/+2
fixes #2839
2019-01-10Make raw content marked `beamer` work in `beamer` output.John MacFarlane1-14/+18
See pandoc/lua-filters#40.
2019-01-10Make 'plain' RawBlocks work for 'plain' output.John MacFarlane1-0/+5
2019-01-09RST reader: change treatment of `number-lines` directives. (#5207)Brian Leung1-15/+15
Directives of this type without numeric inputs should not have a `startFrom` attribute; with a blank value, the writers can produce extra whitespace.
2019-01-09Beamer writer: avoid duplicated `fragile` property in some cases.John MacFarlane1-1/+3
Closes #5208.
2019-01-08EPUB writer: ensure that picture transforms are done on metadata too.John MacFarlane1-6/+6
2019-01-08Removed superfluous sourceCode class on code blocks.John MacFarlane3-11/+7
* These were added by the RST reader and, for literate Haskell, by the Markdown and LaTeX readers. There is no point to this class, and it is not applied consistently by all readers. See #5047. * Reverse order of `literate` and `haskell` classes on code blocks when parsing literate Haskell. Better if `haskell` comes first.
2019-01-08RST reader: handle sourcecode directive as synonynm for code.John MacFarlane1-1/+1
Closes #5204.
2019-01-07Asciidoc writer: shorter delimiters for tables, blockquotes.John MacFarlane1-3/+2
This matches asciidoctor reference docs. Closes #4364.