Commit graph

12047 commits

Author SHA1 Message Date
Jesse Rosenthal
2142bbe572 Docx reader: Fix windows error
Try fixing a parsing error on windows by insisting that the parser use
a Posix filepath library for splitting doc paths in a zipfile. (It
might default on Windows to using a backslash as a separator, while
it's always a forward-slash in zip archives.)
2019-02-07 14:46:56 -05:00
John MacFarlane
4ef23623d3 Use pandoc-citeproc-0.16.0.2 2019-02-07 10:00:21 -08:00
Jesse Rosenthal
b0d55e4f5b Docx reader: Some code cleanup
* 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-07 09:23:28 -05:00
Jesse Rosenthal
9ff4042932 Docx reader: Extend dynamic xml location to detecting relationships
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-07 06:00:37 -05:00
Albert Krewinkel
713ed7c0c5
data/pandoc.lua: re-export List and utils module 2019-02-07 10:10:55 +01:00
Jesse Rosenthal
1847bdbb83 Docx reader: Tests for alternate document.xml 2019-02-06 21:14:46 -05:00
Jesse Rosenthal
4cce0efa48 Docx reader: Dynamically determine document.xml path.
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-06 21:14:46 -05:00
John MacFarlane
5d3b8ede15 cabal.project - use released pandoc-citeproc (take 2). 2019-02-06 17:32:46 -08:00
John MacFarlane
424ec937e0 cabal - prevent using basement 0.0.10 on 32-bit windows.
It is broken, see https://github.com/haskell-foundation/foundation/issues/515
2019-02-06 17:19:58 -08:00
John MacFarlane
54ee40f216 Remove PROVISIONAL from 2.6 changelog. 2019-02-06 15:05:37 -08:00
John MacFarlane
23932d5e05 cabal.project - use released pandoc-citeproc. 2019-02-06 10:56:28 -08:00
John MacFarlane
5e1dc5809b stack.yaml - use latest pandoc-citeproc. 2019-02-06 10:56:11 -08:00
John MacFarlane
2b003d4a6b Handle Word files generated by Microsoft Word Online.
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-06 09:01:26 -08:00
Alexander Krotov
59fa4eb17e Muse reader: test that block level markup does not break <verbatim> 2019-02-06 02:25:24 +03:00
Albert Krewinkel
37a82b0b11 Add missing copyright notices and remove license boilerplate (#5112)
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-04 13:52:31 -08:00
John MacFarlane
4b89311081 More carefully groom ipynb default extensions. 2019-02-04 11:11:38 -08:00
John MacFarlane
977a88f92d Add all_symbols_escapable to githubMarkdownExtensions. 2019-02-04 11:11:13 -08:00
John MacFarlane
ccf4e23ee1 Markdown reader: add newline when parsing blocks in YAML.
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-04 10:22:02 -08:00
John MacFarlane
ca4d308b60 ipynb reader: handle images referring to attachments.
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-02 18:22:43 -08:00
John MacFarlane
d50cb029fd HTML5 template: Add role with ARIA doc-toc for table of contents.
See #4213.
2019-02-02 16:20:19 -08:00
John MacFarlane
b74267406b Update test for last commit. 2019-02-02 16:20:06 -08:00
John MacFarlane
b062117ef4 HTML5 writer: implement WAI-ARIA roles for (end)notes.
See #4213.
2019-02-02 16:14:58 -08:00
John MacFarlane
00cd11c6e2 Shared: withTempDir is no longer used in the codebase.
Add comment to remove it in next major release.
2019-02-02 12:36:32 -08:00
John MacFarlane
cb1ede5b08 PDF: More conservative solution to #777.
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-02 12:35:27 -08:00
John MacFarlane
737c0a684e PDF: use system temp dir and set TEXMFOUTPUT.
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-02 11:31:29 -08:00
Mauro Bieg
9225583ccf
MIME: add WebP
fixes #5267
2019-02-02 10:05:06 +01:00
John MacFarlane
a6e3f1c775 LaTeX writer: use right fold for escapeString.
This is more elegant than the explicit recursive
we were using.
2019-02-01 22:12:54 -08:00
John MacFarlane
f5ebe98773 LaTeX writer: code simplification in escaping. 2019-02-01 21:59:58 -08:00
John MacFarlane
20a0b4433f Markdown writer: use markdown="1" when appropriate for Divs.
When `native_divs` and `markdown_in_html_blocks` are disabled
but `raw_html` and `markdown_attribute` are enabled...
2019-02-01 21:49:02 -08:00
John MacFarlane
633a9ecfec LaTeX writer: avoid {} after control sequences when escaping.
`\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-02-01 21:17:46 -08:00
Albert Krewinkel
b436087bc8
doc/lua-filters.md: fix docs for OrderedList items 2019-02-01 21:19:52 +01:00
John MacFarlane
e752669e50 LaTeX reader: don't let \egroup match {.
`braced` now actually requires nested braces.
Otherwise some legitimate command and environment
definitions can break (see test/command/tex-group.md).
2019-01-31 22:50:51 -08:00
John MacFarlane
7c424b315c Tests: avoid calling findPandoc multiple times. 2019-01-31 20:56:20 -08:00
John MacFarlane
fdf7f07f62 Old tests: remove need for temp files by using pipeProcess. 2019-01-31 17:25:36 -08:00
John MacFarlane
4e6ef53295 More improvements on lua-filters docs. 2019-01-31 10:13:36 -08:00
John MacFarlane
d7a13b4a58 linux/Dockerfile : use default -O1 instead of -O2. 2019-01-30 22:54:08 -08:00
John MacFarlane
13c1cb82b6 stack.yaml - use latest texmath. 2019-01-30 22:10:20 -08:00
John MacFarlane
7974a5d169 Update manual. 2019-01-30 22:00:54 -08:00
John MacFarlane
00c4ef2923 Update changelog. 2019-01-30 21:59:43 -08:00
Tristan Stenner
e782577eec Manual: document date-meta template variable (#5260)
In HTML based formats the `date` metadata variable is converted to ISO 8601
and available as `$date-meta`, but it's not documented at the moment.
2019-01-30 16:39:12 -08:00
John MacFarlane
51f042279c Update copyright year in version. 2019-01-30 14:45:35 -08:00
John MacFarlane
572bd4103c Use lts-13 in makefile 2019-01-30 14:38:35 -08:00
John MacFarlane
18a9c7c0e0 Update stack.yaml to use lts-13. 2019-01-30 14:38:35 -08:00
Albert Krewinkel
7b7db934a8
doc/lua-filters.md: use 3rd level headers for module fields 2019-01-30 21:41:40 +01:00
John MacFarlane
dea292aace Update changelog. 2019-01-30 11:44:47 -08:00
leungbk
ac83b9c37c Org reader: add support for #+SELECT_TAGS. 2019-01-30 18:27:38 +01:00
leungbk
dc43174573 Org reader: separate filtering logic from conversion function. 2019-01-30 18:27:38 +01:00
John MacFarlane
c9454a4176 Add cpp to avoid warning. 2019-01-28 16:50:47 -08:00
John MacFarlane
2932ac8574 Add isPrefixOf to imports. 2019-01-27 12:27:24 -08:00
Agustín Martín Barbero
9894d05fe3 Improve writing metadata for docx, pptx and odt (#5252)
* 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-26 16:14:35 -08:00