aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
AgeCommit message (Collapse)AuthorFilesLines
2019-02-07Revert "Docx reader: Fix windows error"Jesse Rosenthal1-2/+1
This reverts commit 2142bbe572cea00b7bb5ad3e10a3afb26845a1f7.
2019-02-07Docx reader: Fix windows errorJesse Rosenthal1-1/+2
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-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 Krewinkel38-70/+107
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-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-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-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-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-24Ipynb: Put all jupyter metadata under 'jupyter' key.John MacFarlane1-1/+1
2019-01-24Revert "Prepend `jupyter_` to jupyter metadata keys."John MacFarlane1-6/+0
This reverts commit 5eaff399d5d6dc30b0d453eff42c4101674d75ab.
2019-01-24Prepend `jupyter_` to jupyter metadata keys.John MacFarlane1-0/+6
This avoids conflics with things like 'toc'.
2019-01-22Support ipynb (Jupyter notebook) as input and output format.John MacFarlane1-0/+249
[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-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-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-07Org reader: allow for case of :minlevel == 0.John MacFarlane1-1/+3
See #5190.
2019-01-07Org reader: handle `minlevel` option differently. (#5190)Brian Leung1-3/+1
When `minlevel` exceeds the original minimum level observed in the file to be included, every heading should be shifted rightward.
2019-01-07TWiki reader: fix performance issue with underscores.John MacFarlane1-1/+3
Underscore emphasis can't cross table cell boundaries, but the parser wasn't respecting this, leading to exponential behavior in documents with table cells containing underscores. This fixes the original sample; it's possible that there are other performance issues involving underscores. Closes #3921.
2019-01-06Add DokuWiki reader (#5108)Alexander1-0/+529
Closes #1792
2019-01-02Implement task lists (#5139)Mauro Bieg2-3/+7
Closes #3051
2019-01-01Org reader: fix self-link parsing regressionAlbert Krewinkel1-5/+6
Fixes a regression introduced by the previous commit.
2019-01-01Org reader: fix treatment of links to imagesAlbert Krewinkel2-13/+16
Links with descriptions which are pointing to images are no longer read as inline images, but as proper links. Fixes: #5191
2019-01-01Org reader: hlintAlbert Krewinkel1-2/+2
2018-12-31Remove unused HasHeaderMap (#5175)Alexander6-34/+3
It is updated by some readers, but never actually used.
2018-12-31Replace read with safeRead (#5186)Mauro Bieg1-3/+6
closes #5180
2018-12-17LaTeX reader: Support `\DeclareMathOperator`.John MacFarlane1-1/+11
Closes #5149.
2018-12-17Replace read with safeRead. Closes #5162.John MacFarlane3-11/+8
2018-12-17HTML reader: handle empty start attribute.John MacFarlane1-4/+2
See #5162.
2018-12-10Docx: handle level overrides.Jesse Rosenthal1-6/+17
There can be overrides for the definitions of certain levels in numbering definitions. This implements that behavior. Closes: #5134
2018-12-10Docx: add a levelOverride type.Jesse Rosenthal1-3/+20
2018-12-10Docx writer: Make Level into a real type.Jesse Rosenthal2-4/+6
It had previously been an alias for a tuple.
2018-11-29Man reader: use mapLeft from Shared.John MacFarlane1-6/+1
2018-11-29LaTeX reader: Support \inputminted (closes #5103).John MacFarlane1-2/+21
2018-11-25Fix parsing of citations and quotes after parentheses.John MacFarlane1-6/+2
Starting with pandoc 2.4, citations and quoted inlines were no longer recognized after parentheses. This is because of commit 9b0bd4ec6f5c9125efb3e36232e6d1f6ac08a728, which is reverted here. The point of that commit was to allow relocation of soft line breaks to before an abbreviation, so that a nonbreaking space could be added after the abbreviation. Now we simply leave the soft line break in place, even though this means that we won't get a nonbreaking space after "Mr." at the end of a line (and in LaTeX this may result in a longer intersentential space). Those who care about this issue should take care not to end lines with an abbreviation, or to insert nonbreaking spaces manually. Closes #5099.
2018-11-25MediaWiki reader internals: remove unnecessary bindingAlexander Krotov1-2/+1
2018-11-22Hlint suggestions.John MacFarlane2-3/+1
2018-11-19LaTeX reader: cleaned up handling of dimension arguments.John MacFarlane2-6/+12
Allow decimal points, preceding space. Also require text 1.1+.
2018-11-18LaTeX reader: don't allow arguments for verbatim, etc.John MacFarlane1-1/+0
2018-11-18LaTeX reader: Allow space before bracketed options.John MacFarlane1-1/+2
2018-11-18LaTeX reader: allow optional arguments after \\ in tables.John MacFarlane1-1/+2