aboutsummaryrefslogtreecommitdiff
path: root/test/command
AgeCommit message (Collapse)AuthorFilesLines
2021-08-21LaTeX-parser: restrict \endinput to current fileSimon Schuster2-0/+17
2021-08-20RST reader: Fix `:literal:` includes.John MacFarlane1-1/+1
These should create code blocks, not insert raw RST. Closes #7513.
2021-08-17Revise citeproc code to fit new citeproc 0.5 API.John MacFarlane4-8/+8
Linkification of URLs in the bibliography is now done in the citeproc library, depending on the setting of an option. We set that option depending on the value of the metadata field `link-bibliography` (defaulting to true, for consistency with earlier behavior, though the new behavior includes the CSL draft recommendation of hyperlinking the title or the whole entry if a DOI, PMID, PMCID, or URL field is present but not explicitly rendered). These changes implement the following recommendations from the draft CSL v1.0.2 spec (Appendix VI): > The CSL syntax does not have support for configuration of links. > However, processors should include links on bibliographic references, > using the following rules: > If the bibliography entry for an item renders any of the following > identifiers, the identifier should be anchored as a link, with the > target of the link as follows: > - url: output as is > - doi: prepend with "`https://doi.org/`" > - pmid: prepend with "`https://www.ncbi.nlm.nih.gov/pubmed/`" > - pmcid: prepend with "`https://www.ncbi.nlm.nih.gov/pmc/articles/`" > If the identifier is rendered as a URI, include rendered URI components > (e.g. "`https://doi.org/`") in the link anchor. Do not include any other > affix text in the link anchor (e.g. "Available from: ", "doi: ", "PMID: "). > If the bibliography entry for an item does not render any of > the above identifiers, then set the anchor of the link as the item > title. If title is not rendered, then set the anchor of the link as the > full bibliography entry for the item. Set the target of the link as one > of the following, in order of priority: > > - doi: prepend with "`https://doi.org/`" > - pmcid: prepend with "`https://www.ncbi.nlm.nih.gov/pmc/articles/`" > - pmid: prepend with "`https://www.ncbi.nlm.nih.gov/pubmed/`" > - url: output as is > > If the item data does not include any of the above identifiers, do not > include a link. > > Citation processors should include an option flag for calling > applications to disable bibliography linking behavior. Thanks to Benjamin Bray for getting this all working.
2021-08-15Remove misleading description from command/citeproc-87 test.John MacFarlane1-5/+2
2021-08-13Convert Quoted in bib entries to special Spans...John MacFarlane1-0/+42
before passing them off to citeproc. This ensures that we get proper localization and flipflopping if, e.g., quotes are used in titles. Closes jgm/citeproc#87.
2021-08-13Citeproc: avoid odd handling of quotes.John MacFarlane1-0/+16
citeproc changes allow us to ignore Quoted elements; citeproc now uses its own method for represented quoted things, and only localizes and flipflops quotes it adds itself. See #87. The one thing left to do is to convert Quoted elements in bibliography databases (esp. titles) to `Span ("",["csl-quoted"],[])` before passing them to citeproc, IF the localized quotes for the quote type match the standard inverted commas.
2021-08-13Fix raw LaTeX injection issue (LaTeX writer).John MacFarlane1-0/+37
Using a code block containing `\end{verbatim}`, one could inject raw TeX into a LaTeX document even when `raw_tex` is disabled. Thanks to Augustin Laville for noticing the bug. Closes #7497.
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-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-03LaTeX table writer: Increase column width precision (#7466)Peter Fabinski2-2/+2
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-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-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-02HTML5 writer, remove aria-hidden when explicit atl text is provided.Aner Lucero1-1/+1
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 MacFarlane1-1/+1
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 MacFarlane1-2/+6
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-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-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-28Support `rebase_relative_paths` for commonmark based formats.John MacFarlane1-0/+16
(Including `gfm`.)
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
2021-05-27rebase_relative_paths extension: don't change fragment paths.John MacFarlane2-0/+5
We don't want a pure fragment path to be rewritten, since these are used for cross-referencing.
2021-05-27Modify rebase_reference_links treatment of reference links/images.John MacFarlane3-1/+8
The directory is based on the file containing the link reference, not the file containing the link, if these differ.
2021-05-27Citeproc: Don't detect math elements as locators.John MacFarlane1-0/+24
Closes #7321.
2021-05-27Add `rebase_relative_paths` extension.John MacFarlane5-0/+49
- Add manual entry for (non-default) extension `rebase_relative_paths`. - Add constructor `Ext_rebase_relative_paths` to `Extensions` in Text.Pandoc.Extensions [API change]. When enabled, this extension rewrites relative image and link paths by prepending the (relative) directory of the containing file. - Make Markdown reader sensitive to the new extension. - Add tests for #3752. Closes #3752. NB. currently the extension applies to markdown and associated readers but not commonmark/gfm.
2021-05-27LaTeX reader: improve `\def` and implement `\newif`.John MacFarlane1-0/+55
- Improve parsing of `\def` macros. We previously set "verbatim mode" even for parsing the initial `\def`; this caused problems for things like ``` \def\foo{\def\bar{BAR}} \foo \bar ``` - Implement `\newif`. - Add tests.
2021-05-26Command tests: fail if a file contains no tests.John MacFarlane1-3/+5
And fix a test that failed in that way!
2021-05-25Fix a command test so it writes to stdout not stderr.John MacFarlane1-1/+1
The error message to stderr was appearing in test output and confusing some users, who thought it indicated a failing test rather than expected output.
2021-05-25Logging: remove single quotes around paths in messages.John MacFarlane2-2/+2
We weren't doing it consistently and it seems unnecessary.
2021-05-22Handle relative lengths (e.g. `2*`) in HTML column widths.John MacFarlane1-0/+29
See <https://www.w3.org/TR/html4/types.html#h-6.6>. "A relative length has the form "i*", where "i" is an integer. When allotting space among elements competing for that space, user agents allot pixel and percentage lengths first, then divide up remaining available space among relative lengths. Each relative length receives a portion of the available space that is proportional to the integer preceding the "*". The value "*" is equivalent to "1*". Thus, if 60 pixels of space are available after the user agent allots pixel and percentage space, and the competing relative lengths are 1*, 2*, and 3*, the 1* will be alloted 10 pixels, the 2* will be alloted 20 pixels, and the 3* will be alloted 30 pixels." Closes #4063.
2021-05-20DocBook reader: ensure that first and last names are separated.John MacFarlane1-0/+27
Closes #6541.
2021-05-20Ms writer: handle tables with multiple paragraphs.John MacFarlane1-0/+40
Previously they overflowed the table cell width. We now set line lengths per-cell and restore them after the table has been written. Closes #7288.
2021-05-20LaTeX reader: More siunitx improvements. Closes #6658.John MacFarlane1-6/+66
There's still one slight divergence from the siunitx behavior: we get 'kg m/A/s' instead of 'kg m/(A s)'. At the moment I'm not going to worry about that.
2021-05-20LaTeX/siunitx: fix parsing of `\cubic` etc. See #6658.John MacFarlane1-0/+3