aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-08-12Bump base-compat version so we get compatibility with base 4.12.John MacFarlane1-1/+1
2021-08-12Use Prelude from base-compat for ghc 8.4 too.John MacFarlane2-6/+2
We were having trouble building on ghc 8.4 because of the lack of a Foldable instance for (Alt Maybe) in base < 4.12. Mystery: for some reason our builds were failing for gitit but not in the pandoc CI.
2021-08-12Add haskell-language-server to shell.nix (#7496)Emily Bourke1-0/+1
I find it useful to have this installed via the nix shell when working on pandoc, so I think others may also find it useful. Co-authored-by: Emily Bourke <undergroundquizscene@protonmail.com>
2021-08-11Try fixing compile error on older ghcs.John MacFarlane1-1/+5
See https://github.com/jgm/gitit/runs/3308381697
2021-08-11Fix some lint issues.John MacFarlane2-6/+5
2021-08-11LaTeX reader: Support `\global` before `\def`, `\let`, etc.John MacFarlane2-2/+22
See #7494.
2021-08-11Fix scope for LaTeX macros.John MacFarlane4-55/+150
They should by default scope over the group in which they are defined (except `\gdef` and `\xdef`, which are global). In addition, environments must be treated as groups. We handle this by making sMacros in the LaTeX parser state a STACK of macro tables. Opening a group adds a table to the stack, closing one removes one. Only the top of the stack is queried. This commit adds a parameter for scope to the Macro constructor (not exported). Closes #7494.
2021-08-11Clarify internal punctuation in citation keys. (#7491)William Lupton1-5/+8
Addresses a comment in #5458.
2021-08-11LaTeX reader: improve handling of plain TeX macro primitives.John MacFarlane3-7/+66
- Fixed semantics for `\let`. - Implement `\edef`, `\gdef`, and `\xdef`. - Add comment noting that currently `\def` and `\edef` set global macros (so are equivalent to `\gdef` and `\xdef`). This should be fixed by scoping macro definitions to groups, in a future commit. Closes #7474.
2021-08-10Tests.Helpers: export testGolden and use it in RTF reader.John MacFarlane2-13/+27
This gives a diff output on failure.
2021-08-10HTML reader: treat commments as blank when parsing.John MacFarlane2-5/+54
This modifies pBlank. Previously comments could sometimes flummox the parser. Cloes #7482.
2021-08-10Add test for #7488.John MacFarlane3-0/+447
2021-08-10Fix RTF table parsing bug that created undesired nested tables.John MacFarlane1-1/+1
Closes #7488.
2021-08-10Add RTF reader.John MacFarlane31-4/+2292
- `rtf` is now supported as an input format as well as output. - New module Text.Pandoc.Readers.RTF (exporting `readRTF`). [API change] Closes #3982.
2021-08-08Allow `--slide-level=0`.John MacFarlane2-7/+9
When the slide level is set to 0, headings won't be used at all in splitting the document into slides. Horizontal rules must be used to separate slides. Closes #7476.
2021-08-08Remove obsolete and incorrect sentence in `--slide-level` docs.John MacFarlane1-3/+1
2021-08-04RTF writer: emit \outlinelevel for section headings.John MacFarlane2-32/+33
2021-08-03Stop using the HTTP package. (#7456)mt_caret7-12/+30
We only depend on the urlEncode function in the package, which is also provided by http-types. The HTTP package also depends on the network package, which has difficulty building on ghcjs. Add internal module Text.Pandoc.Network.HTTP, exporting `urlEncode`.
2021-08-03LaTeX table writer: Increase column width precision (#7466)Peter Fabinski6-21/+21
In some cases, the rounding performed by the LaTeX table writer would introduce visible overrun outside the text area. This adds two more decimal places to the width values.
2021-08-01RTF writer: omit `\bin` in `\pict`.John MacFarlane2-3/+3
According to the spec, this is not needed or wanted when the data is in hexadecimal format, as it is here.
2021-08-01Add a faq about the "Cannot allocate memory" error on M1 macs.John MacFarlane1-0/+8
2021-08-01RTF template: specify font family for fixed-width font f1.John MacFarlane2-2/+2
According to the spec, this is mandatory.
2021-07-29parseFromString: preserve at least the source directory.John MacFarlane1-1/+1
Previously we just set the source name to "chunk" when parsing from strings, to avoid misleading source positions. This had the side effect that `rebase_relative_paths` would break inside sections that were parsed as strings. So, now we use "ORIGINAL_SOURCE_PATH_chunk" instead of just "chunk". Closes #7464.
2021-07-22LaTeX writer: Use ulem for underline.John MacFarlane2-1/+4
ulem is conditionally included already when the `strikeout` variable is set, so we set this when there is underlined text, and use `\uline` instead of `\underline`. This fixes wrapping for underlined text. Closes #7351.
2021-07-22MIME: use image/x-xcf instead of application/x-xcf.John MacFarlane1-1/+1
Closes #7454.
2021-07-19INSTALL.md: Add GitLab CI/CD example (#7448)Veratyr1-0/+6
2021-07-18Bump to 2.14.1, update changelog and man page.John MacFarlane4-5/+150
2021-07-18Fix comment syntax in cabal.projectJohn MacFarlane1-4/+4
2021-07-18Use doctemplates 0.4.1 and citeproc 0.10.John MacFarlane3-15/+8
2021-07-17Use skylighting 0.11.John MacFarlane2-4/+4
2021-07-17LaTeX reader: avoid trailing hyphen in translating languages.John MacFarlane1-2/+2
Previously `\foreignlanguage{english}` turned into `<span lang="en-">`. The same issue affected Arabic. Closes #7447.
2021-07-16DocBook reader: handle images with imageobjectco elements.John MacFarlane1-3/+3
Closes #7440.
2021-07-16LaTeX reader: Support `\cline` in LaTeX tables.John MacFarlane1-0/+1
Closes #7442.
2021-07-16PDF: Fix svgIn path error.John MacFarlane1-1/+1
We were duplicating the temp directory; this didn't show up on macOS or linux because there we use absolute paths for the temp directory. Closes #7431.
2021-07-11DocBook reader: add support for citerefentry (#7437)Jan Tojnar3-1/+9
Originally intended for referring to UNIX manual pages, either part of the same DocBook document as refentry element, or external – hence the manvolnum element. These days, refentry is more general, for example the element documentation pages linked below are each a refentry. As per the *Processing expectations* section of citerefentry, the element is supposed to be a hyperlink to a refentry (when in the same document) but pandoc does not support refentry tag at the moment so that is moot. https://tdg.docbook.org/tdg/5.1/citerefentry.html https://tdg.docbook.org/tdg/5.1/manvolnum.html https://tdg.docbook.org/tdg/5.1/refentry.html This roughly corresponds to a `manpage` role in rST syntax, which produces a `Code` AST node with attributes `.interpreted-text role=manpage` but that does not fit DocBook parser. https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-manpage
2021-07-11Improved parsing of raw LaTeX from Text streams (rawLaTeXParser).John MacFarlane3-11/+52
We now use source positions from the token stream to tell us how much of the text stream to consume. Getting this to work required a few other changes to make token source positions accurate. Closes #7434.
2021-07-09Always use / when adding directory to image path with extractMedia.John MacFarlane1-1/+1
Even on Windows. May help with #7431.
2021-07-09RST reader: fix regression with code includes.John MacFarlane4-1/+23
With the recent changes to include infrastructure, included code blocks were getting an extra newline. Closes #7436. Added regression test.
2021-07-07Don't incorporate externally linked images in EPUB documents (#7430)Michael Hoffmann2-1/+8
Just like it is possible to avoid incorporating an image in EPUB by passing `data-external="1"` to a raw HTML snippet, this makes the same possible for native Images, by looking for an associated `external` attribute.
2021-07-06Recognize data-external when reading HTML img tags (#7429)Michael Hoffmann2-8/+9
Preserve all attributes in img tags. If attributes have a `data-` prefix, it will be stripped. In particular, this preserves a `data-external` attribute as an `external` attribute in the pandoc AST.
2021-07-06T.P.PDF, convertImage: normalize paths.John MacFarlane1-3/+3
This will avoid paths on Windows with mixed path separators, which may cause problems with SVG conversion. See #7431.
2021-07-06Markdown reader: don't try to read contents in self-closing HTML tag.John MacFarlane1-1/+4
Previously we had problems parsing raw HTML with self-closing tags like `<col/>`. The problem was that pandoc would look for a closing tag to close the markdown contents, but the closing tag had, in effect, already been parsed by `htmlTag`. This fixes the issue described in <https://groups.google.com/d/msgid/pandoc-discuss/297bc662-7841-4423-bcbb-534e99bbba09n%40googlegroups.com>.
2021-07-06HTML reader: add col, colgroup to 'closes' definitionsJohn MacFarlane1-1/+3
2021-07-05Add command test for #7394.John MacFarlane2-0/+86
And fix a small bug in handling of citations in notes, which led to commas at the end of sentences in some cases.
2021-07-05Citeproc: cleanup and efficiency improvement in deNote.John MacFarlane1-15/+21
2021-07-05Revamp note citation handling.John MacFarlane3-16/+32
Use latest citeproc, which uses a Span with a class rather than a Note for notes. This helps us distinguish between user notes and citation notes. Don't put citations at the beginning of a note in parentheses. (Closes #7394.)
2021-07-05document-css: reset overflow-wrap on code blocksMauro Bieg5-5/+10
fixes #7423
2021-07-03Add FAQ on converting from/to PDFJohn MacFarlane1-0/+18
2021-07-03Revert "LaTeX template: move title, author, date up to top of preamble."John MacFarlane5-42/+42
This reverts commit cc088687b4013c2b8b744eb337ed04fc63f315f2 and PR #7295. This fixes issues people had when using LaTeX commands defined later in the preamble (or in some cases UTF-8 text) in the title or author fields. Closes #7422.
2021-07-03Add doc/faqs.md.John MacFarlane1-0/+110
This is imported from the website; in the future the website version will be drawn from here. Added a FAQ on the use of `\AtEndPreamble` for cases when the contents of `header-includes` need to refer to definitions that come later in the preamble. See #7422.