aboutsummaryrefslogtreecommitdiff
path: root/test/command
AgeCommit message (Collapse)Author
2022-01-28HTML writer: avoid duplicate "style" attributes on table cellsAlbert Krewinkel
Fixes: #7871
2022-01-28Don't read files outside of user data directoryEven Brenden
If a file path does not exist relative to the working directory, but it does exist relative to the user data directory, and it exists outside of the user data directory, do not read it. This applies to readDataFile and readMetadataFile in PandocMonad and, by extension, any module that uses these by passing them relative paths.
2022-01-23CommonMark reader: fix source position after YAML metadata.John MacFarlane
Closes #7863.
2022-01-21Update command tests to distinguish stderr and test exit status.John MacFarlane
2022-01-21Search for metadata files in $DATADIR/metadata (#7851)Even Brenden
If files specified with `--metadata-file` are not found in the working directory, look in `$DATADIR/metadata`. Expose new `readMetadataFile` function from Text.Pandoc.Class [API change]. Expose new `PandocCouldNotFindMetadataFileError` constructor for `PandocError` from Text.Pandoc.Error [API change]. Closes #5876.
2022-01-20Avoid putting a frame around speaker notes in beamer.John MacFarlane
If speaker notes (a Div with class 'notes') occur right after a section heading, but above slide level, the resulting `\note{..}` caommand should not be wrapped in a frame, as that will cause a spurious blank slide. Closes #7857.
2022-01-20HTML writer: don't break lines inside code elements.John MacFarlane
With the new (default) line wrapping of HTML, in conjunction with the default CSS which includes `code { whitespace: pre-wrap; }`, spurious line breaks could be introduced into inline code. Closes #7858.
2022-01-19Markdown writer: handle explicit column widths with pipe tables.John MacFarlane
If a table has explicit column width information *and* the content extends beyond the `--columns` width, we need to adjust the widths of the pipe separators to encode this width information. Closes #7847.
2022-01-19Remove unused file test/command/jats.cslAlbert Krewinkel
2022-01-15Man writer: use custom font V for inline code.John MacFarlane
The V font is defined conditionally, so that it renders like CB in output formats that support that, and like B in those that don't (e.g. the terminal). We could just redefine C, but this would affect code blocks, too, and putting them all in boldface looks ugly, I think. Possible drawback: fragments created by pandoc's man writer will presuppose a nonstandard V font. Closes #7506. Supersedes 253467a549dcc22384be96041fd6f886c4a7a935.
2022-01-15Man writer: Use boldface for inline code.John MacFarlane
Closes #7506. This also allows us to get rid of some special casing on definition lists that ensured that options in code spans would be boldface. (If this change is ever reverted, we'll need that again.)
2022-01-13Add test for #7826 notes-after-punctuation.John MacFarlane
2022-01-10HTML writer: don't break attributes values when wrapping.John MacFarlane
2022-01-10Fix regression: allow blank lines in HTML attributes.John MacFarlane
The commit 7a9832166e36f77402d5e0259647e9f5c7ba4e58 had the effect that blank lines would be collapsed in HTML attributes. We also roll back a change that collapsed multiple spaces into one.
2022-01-08Org writer: fix list items starting with a code block...John MacFarlane
or other non-paragraph content. Closes #7810.
2022-01-07Fix parsing of footnotes in `--metadata-file`.John MacFarlane
Closes #7813.
2022-01-06MediaWiki writer: Remove redundant display text for wiki linksJesse Hathaway
Prior to this commit the MediaWiki writer always added the display text for a wiki link: * [[Help|Help]] * [[Bubbles|Everyone loves bubbles]] However the display text in the first example is redundant since MediaWiki uses the target as the default display text. The result being: * [[Help]] * [[Bubbles|Everyone loves bubbles]]
2022-01-05AsciiDoc writer: improve detection of intraword emphasis.John MacFarlane
Closes #7803.
2021-12-28OpenDocument writer: fix vertical align bug with display math.John MacFarlane
Previously some displayed formulas would be floated above a preceding text line. This is fixed by setting vertical-rel to 'text' rather than 'paragraph-content'. Closes #7777.
2021-12-22HTML writer: make line breaks more consistent.John MacFarlane
- With `--wrap=none`, we now output line breaks between block-level elements. Previously they were omitted entirely, so the whole document was on one line, unless there were literal line breaks in pre sections. This makes the HTML writer's behavior more consistent with that of other writers. - Put newline after `<dd>`. - Put newlines after block-level elements in footnote section.
2021-12-22Add text wrapping to HTML output.John MacFarlane
Previously the HTML writer was exceptional in not being sensitive to the `--wrap` option. With this change `--wrap` now works for HTML. The default (as with other formats) is automatic wrapping to 72 columns. A new internal module, T.P.Writers.Blaze, exports `layoutMarkup`. This converts a blaze Html structure into a doclayout Doc Text. In addition, we now add a line break between an `img` tag and the associated `figcaption`. Note: Output is never wrapped in `writeHtmlStringForEPUB`. This accords with previous behavior since previously the HTML writer was insensitive to `--wrap` settings. There's no real need to wrap HTML inside a zipped container. Note that the contents of script, textarea, and pre tags are always laid out with the `flush` combinator, so that unwanted spaces won't be introduced if these occur in an indented context in a template. Closes #7764.
2021-12-18Citeproc: avoid adding comma before an author-in-text citation...John MacFarlane
...in a note if it begins with a title (no author). Closes #7761.
2021-12-14Org reader: parse official org-cite citations.John MacFarlane
We also support the older org-ref style as a fallback. We no longer support the "markdown-style" citations. See #7329.
2021-12-13Org writer: add tests for org-cite citations, and improve support.John MacFarlane
2021-12-07Add test for #7738.John MacFarlane
2021-12-03Improve Markdown writer escaping.John MacFarlane
This fixes escaping for '#' in particular. Closes #7726.
2021-11-30Markdown reader: don't allow `^` at beginning of link or image label.John MacFarlane
This is reserved for footnotes. Fixes a regression introduced by 0a93acf. Closes #7723.
2021-11-24LaTeX reader: Fix semantics of `\ref`.John MacFarlane
We were including the ams environment type in addition to the number. This is proper behavior for `\cref` but not for `\ref`. To support `\cref` we need to store the environment label separately.
2021-11-24LaTeX reader: omit visible content for `\label{...}`.John MacFarlane
Previously we included the text of the label in square brackets, but this is undesirable in many cases. See discussion in <https://github.com/jgm/pandoc/issues/813#issuecomment-978232426>.
2021-11-24HTML reader: parse attributes on links and images.John MacFarlane
Closes #6970.
2021-11-23Improve detection of pipe table line widths.John MacFarlane
Fixed calculation of maximum column widths in pipe tables. It is now based on the length of the markdown line, rather than a "stringified" version of the parsed line. This should be more predictable for users. In addition, we take into account double-wide characters such as emojis. Closes #7713.
2021-11-20Capture `alt-text` in JATS figures (#7703)Albert Krewinkel
Co-authored-by: Aner Lucero <[email protected]>
2021-11-19MediaWiki writer: fix code for generating spans for header IDs.John MacFarlane
We need to generate a span when the header's ID doesn't match the one MediaWiki would generate automatically. But MediaWiki's generation scheme is different from ours (it uses uppercase letters, and `_` instead of `-`, for example). This means that in going from markdown -> mediawiki, we'll now get spans before almost every heading, unless explicit identifiers are used that correspond to the ones MediaWiki auto-generates. This is uglier output but it's necessary for internal links to work properly. See #7697.
2021-11-19HTML writer: Don't create invalid `data-` attribute...John MacFarlane
for empty attribute key. (It would be better to make these unrepresentable in the type system, but for now this is an improvement.) Closes #7546.
2021-11-18MediaWiki writer: use HTML spans for anchors when header has id.John MacFarlane
Closes #7697.
2021-11-15Markdown writer: don't create autolinks when this loses information.John MacFarlane
Previously we sometimes lost attributes when rendering links as autolinks. Closes #7692.
2021-11-15LaTeX reader: add rudimentary support for `\autoref` (#7693)Albert Krewinkel
2021-11-08Properly handle commented lines in BibTeX/BibLaTeX.John MacFarlane
Closes #7668.
2021-11-07LaTeX reader: add 'uri' class when parsing `\url`.John MacFarlane
Closes #7672.
2021-10-27Switch back from HsYAML to yaml.John MacFarlane
Reasons: - Performance: HsYAML is around 20 times slower in parsing large YAML bibliographies (#6084). - An issue was submitted to HsYAML, but it hasn't gotten any attention. HsYAML seems borderline unmaintained; it hasn't had a commit in over a year. - Unfortunately this goes back on our attempts to free ourselves from C dependencies (#4535). But I don't see a better alternative until a better pure Haskell parser is available. Closes #6084. Notes: - We've removed the FromYAML instances for all types that had them, since this is a HsYAML-specific typeclass [API change]. (The yaml package just uses From/ToJSON.) - Unlike HsYAML (in the configuration we were using), yaml parses 'Y', 'N', 'Yes', 'No', 'On', 'Off' as boolean values. Users may need to quote these when they are meant to be interpreted as strings. Similarly, 'null' is parsed as a YAML null value (and will be treated as an empty string by pandoc rather than the string 'null'). Quoting it will force it to be interpreted as a string. - Some tests had to be adjusted accordingly. - Pandoc now behaves better when the YAML metadata contains escaping errors: instead of just falling back on treating the section as a table, it raises a YAML parsing error.
2021-10-22Org reader: allow an initial :PROPERTIES: drawer to add to metadata.John MacFarlane
Closes #7520.
2021-10-20Markdown reader: don't parse links or bracketed spans as citations.John MacFarlane
Previously pandoc would parse [link to (@a)](url) as a citation; similarly [(@a)]{#ident} This is undesirable. One should be able to use example references in citations, and even if `@a` is not defined as an example reference, `[@a](url)` should be a link containing an author-in-text citation rather than a normal citation followed by literal `(url)`. Closes #7632.
2021-10-13Fix markdown parsing bug for math in bracketed spans and links.John MacFarlane
This affects math with unbalanced brackets (e.g. `$(0,1]$`) inside links, images, bracketed spans. Closes #7623.
2021-10-10LaTeX reader: Properly handle `\^` followed by group closing.John MacFarlane
Closes #7615.
2021-09-29Further test updates for switch to pretty-show.John MacFarlane
2021-09-28Switch from pretty-simple to pretty-show for native output.John MacFarlane
Update tests. Reason: it turns out that the native output generated by pretty-simple isn't always readable by the native reader. According to https://github.com/cdepillabout/pretty-simple/issues/99 it is not a design goal of the library that the rendered values be readable using 'read'. This makes it unsuitable for our purposes. pretty-show is a bit slower and it uses 4-space indents (non-configurable), but it doesn't have this serious drawback.
2021-09-23BibTeX parser: fix expansion of special strings in series...John MacFarlane
e.g. `newseries` or `library`. Expansion should not happen when these strings are protected in braces, or when they're capitalized. Closes #7591.
2021-09-23HTML reader: handle empty tbody element in table.John MacFarlane
Closes #7589.
2021-09-21Use pretty-simple to format native output.John MacFarlane
Previously we used our own homespun formatting. But this produces over-long lines that aren't ideal for diffs in tests. Easier to use something off-the-shelf and standard. Closes #7580. Performance is slower by about a factor of 10, but this isn't really a problem because native isn't suitable as a serialization format. (For serialization you should use json, because the reader is so much faster than native.)
2021-09-21Add missing `%` on command tests.John MacFarlane
This prevented `--accept` from working properly.