aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2021-08-11LaTeX reader: Support `\global` before `\def`, `\let`, etc.John MacFarlane1-0/+12
See #7494.
2021-08-11Fix scope for LaTeX macros.John MacFarlane1-0/+50
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-11LaTeX reader: improve handling of plain TeX macro primitives.John MacFarlane1-1/+37
- 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 MacFarlane1-0/+47
This modifies pBlank. Previously comments could sometimes flummox the parser. Cloes #7482.
2021-08-10Add test for #7488.John MacFarlane3-0/+447
2021-08-10Add RTF reader.John MacFarlane27-4/+951
- `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-04RTF writer: emit \outlinelevel for section headings.John MacFarlane1-31/+31
2021-08-03LaTeX table writer: Increase column width precision (#7466)Peter Fabinski5-20/+20
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 MacFarlane1-2/+2
According to the spec, this is not needed or wanted when the data is in hexadecimal format, as it is here.
2021-08-01RTF template: specify font family for fixed-width font f1.John MacFarlane1-1/+1
According to the spec, this is mandatory.
2021-07-11DocBook reader: add support for citerefentry (#7437)Jan Tojnar2-0/+4
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 MacFarlane1-0/+15
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-09RST reader: fix regression with code includes.John MacFarlane2-0/+17
With the recent changes to include infrastructure, included code blocks were getting an extra newline. Closes #7436. Added regression test.
2021-07-06Recognize data-external when reading HTML img tags (#7429)Michael Hoffmann1-0/+6
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-05Add command test for #7394.John MacFarlane1-0/+85
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-05document-css: reset overflow-wrap on code blocksMauro Bieg4-4/+8
fixes #7423
2021-07-03Revert "LaTeX template: move title, author, date up to top of preamble."John MacFarlane4-13/+13
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-02HTML5 writer, remove aria-hidden when explicit atl text is provided.Aner Lucero1-1/+1
2021-06-29Docx writer: Add table numbering for captioned tables.John MacFarlane2-1/+3
The numbers are added using fields, so that Word can create a list of tables that will update automatically.
2021-06-29Docx writer: support figure numbers.John MacFarlane1-0/+0
These are set up in such a way that they will work with Word's automatic table of figures. Closes #7392.
2021-06-29Use dev version of citeproc.John MacFarlane2-14/+13
This eliminates double hyperlinks in author-in-text citations. Author-only citations are no longer hyperlinked. See jgm/citeproc#77.
2021-06-29Remove duplicated alt text in HTML output.Aner Lucero1-0/+19
2021-06-28Improve punctuation moving with `--citeproc`.John MacFarlane2-3/+3
Previously, using `--citeproc` could cause punctuation to move in quotes even when there aer no citations. This has been changed; now, punctuation moving is limited to citations. In addition, we only move footnotes around punctuation if the style is a note style, even if `notes-after-punctuation` is `true`.
2021-06-28Markdown writer: put space between Plain and following fenced Div.John MacFarlane1-0/+15
Closes #4465.
2021-06-22Fix regression with comment-only YAML metadata blocks.John MacFarlane1-0/+9
Closes #7400.
2021-06-21LaTeX writer: add strut at end of minipage if it contains...John MacFarlane2-5/+5
line breaks. Without them, the last line is shorter than it should be, at least in some cases.
2021-06-21Update command test for change to LaTeX LineBreak handling.John MacFarlane1-2/+2
2021-06-21LaTeX writer: always use a minipage for cells with line breaks...John MacFarlane1-1/+4
if width information is available. Otherwise the way we treat them can lead to content that overflows a cell. Closes #7393.
2021-06-21Fix test for #7397John MacFarlane1-2/+2
2021-06-21Markdown writer: Fix regression in code blocks with attributes.John MacFarlane1-0/+14
Code blocks with a single class but nonempty attributes were having attributes drop as a result of #7242. Closes #7397.
2021-06-12Fix regression in citeproc processing.John MacFarlane2-7/+18
If inline references are used (in the metadata `references` field), we should still only include in the bibliography items that are actually cited -- unless `nocite` is used. Closes #7376.
2021-06-05LaTeX writer: Fix regression in table header position.John MacFarlane5-15/+69
In recent versions the table headers were no longer bottom-aligned (if more than one line). This patch fixes that by using minipages for table headers in non-simple tables. Closes #7347.
2021-06-05DocBook writer: Remove non-existent admonitionsJan Tojnar1-6/+6
attention, error and hint are actually just reStructuredText specific. danger was too until introduced in DocBook 5.2: https://github.com/docbook/docbook/issues/55
2021-06-01Markdown reader: fix pipe table regression in 2.11.4.John MacFarlane1-10/+2
Previously pipe tables with empty headers (that is, a header line with all empty cells) would be rendered as headerless tables. This broke in 2.11.4. The fix here is to produce an AST with an empty table head when a pipe table has all empty header cells. Closes #7343.
2021-06-01LaTeX reader: don't allow optional * on symbol control sequences.John MacFarlane1-0/+6
Generally we allow optional starred variants of LaTeX commands (since many allow them, and if we don't accept these explicitly, ignoring the star usually gives acceptable results). But we don't want to do this for `\(*\)` and similar cases. Closes #7340.
2021-05-31Fix regression with commonmark/gfm yaml metdata block parsing.John MacFarlane1-0/+11
A regression in 2.14 led to the document body being omitted after YAML metadata in some cases. This is now fixed. Closes #7339.
2021-05-30Have LoadedResource use relative paths.John MacFarlane1-3/+3
The immediate reason for this is to allow the test output of #3752 to work on both windows and linux.
2021-05-29Fix test #3752 (1) for Windows.John MacFarlane1-1/+1
2021-05-29Further test image size reductions.John MacFarlane2-1/+1
2021-05-29Replace biblatex-exmaples.bib with shorter averroes.bib in tests.John MacFarlane3-1675/+96
2021-05-29Further test image size reductions.John MacFarlane2-0/+0
2021-05-29Reduce size of image in fb2 image test.John MacFarlane1-0/+0
2021-05-29Reduce size of cover image in test epub.John MacFarlane2-1/+1
2021-05-29Modify pptx tests to take a whole lot less space.John MacFarlane22-0/+0
- Replace a 300K image in the reference pptx with a 2K one. - Updated all the *_templated.pptx files based on the new reference pptx. - These changes should reduce the size of the tarball by roughly 7 MB! See haskell/hackage-server#935
2021-05-28Support `rebase_relative_paths` for commonmark based formats.John MacFarlane1-0/+16
(Including `gfm`.)
2021-05-28Docx reader: Support new table features.Emily Bourke12-19/+324
* Column spans * Row spans - The spec says that if the `val` attribute is ommitted, its value should be assumed to be `continue`, and that its values are restricted to {`restart`, `continue`}. If the value has any other value, I think it seems reasonable to default it to `continue`. It might cause problems if the spec is extended in the future by adding a third possible value, in which case this would probably give incorrect behaviour, and wouldn't error. * Allow multiple header rows * Include table description in simple caption - The table description element is like alt text for a table (along with the table caption element). It seems like we should include this somewhere, but I’m not 100% sure how – I’m pairing it with the simple caption for the moment. (Should it maybe go in the block caption instead?) * Detect table captions - Check for caption paragraph style /and/ either the simple or complex table field. This means the caption detection fails for captions which don’t contain a field, as in an example doc I added as a test. However, I think it’s better to be too conservative: a missed table caption will still show up as a paragraph next to the table, whereas if I incorrectly classify something else as a table caption it could cause havoc by pairing it up with a table it’s not at all related to, or dropping it entirely. * Update tests and add new ones Partially fixes: #6316
2021-05-28Docx reader: Read table column widths.Emily Bourke12-27/+124
2021-05-27Two citeproc locator/suffix improvements:John MacFarlane2-0/+54
- Recognize locators spelled with a capital letter. Closes #7323. - Add a comma and a space in front of the suffix if it doesn't start with space or punctuation. Closes #7324.
2021-05-27rebase_relative_paths: leave empty paths unchanged.John MacFarlane2-0/+5