aboutsummaryrefslogtreecommitdiff
path: root/test/command
AgeCommit message (Collapse)AuthorFilesLines
2019-12-05Roll back part of of `--shift-heading-level-by` change.John MacFarlane1-3/+2
With positive heading shifts, starting in 2.8 this option caused metadata titles to be removed and changed to regular headings. This behavior is incompatible with the old behavior of `--base-header-level` and breaks old workflows, so with this commit we are rolling back this change. Now, there is an asymmetry in positive and negative heading level shifts: + With positive shifts, the metadata title stays the same and does not get changed to a heading in the body. + With negative shifts, a heading can be converted into the metadata title. I think this is a desirable combination of features, despite the asymmetry. One might, e.g., want to have a document with level-1 section headigs, but render it to HTML with level-2 headings, retaining the metadata title (which pandoc will render as a level-1 heading with the default template). Closes #5957. Revises #5615.
2019-12-05HTML writer: add task-list class to ul if all elements are task list items.John MacFarlane1-4/+4
This will allow styling unordered task lists in a way that omits the bullet.
2019-12-05Fix makeSections so it doesn't turn column divs into sections.John MacFarlane1-0/+28
2019-11-25RST writers: Use grid tables for 1-column tables.John MacFarlane1-0/+40
With simple tables, we have a clash with heading syntax. Closes #5936.
2019-11-19Improve markdown escaping in list items.John MacFarlane1-0/+6
Closes #5918.
2019-11-15RST writer: Improve spacing for tables with no width information.John MacFarlane2-9/+68
If a simple table would be too wide, we use a grid table. The code for generating grid tables has been adjusted to give more intelligent column widths when widths aren't given. (This also affects the markdown writer.) Closes #5899.
2019-11-14Change optInputFiles to a `Maybe [FilePath]`.John MacFarlane1-1/+1
`Nothing` means: nothing specified. `Just []` means: an empty list specified (e.g. in defaults). Potentially these could lead to different behavior: see #5888.
2019-11-14Allow combining `-Vheader-includes` and `--include-in-header`.John MacFarlane1-0/+2
Closes #5904.
2019-11-14Fixed some test locations and put test data files in extra-source-files.John MacFarlane8-2/+11
2019-11-14Fix regression preventing header-includes from being set using -V.John MacFarlane1-0/+8
See #5904.
2019-11-13Add test for #5881.John MacFarlane1-0/+14
2019-11-13Ensure there's a blank line before RST tables.John MacFarlane1-0/+36
Closes #5898.
2019-11-11Markdown reader: fix small super/subscript issue.John MacFarlane1-0/+7
Superscripts and subscripts cannot contain spaces, but newlines were previously allowed (unintentionally). This led to bad interactions in some cases with footnotes. E.g. ``` foo^[note] bar^[note] ``` With this change newlines are also not allowed inside super/subscripts. Closes #5878.
2019-11-11Change the implementation of `htmlSpanLikeElements` and implement `<dfn>` ↵Florian Beeres1-0/+20
(#5882) * Add HTML Reader support for `<dfn>`, parsing this as a Span with class `dfn`. * Change `htmlSpanLikeElements` implementation to retain classes, attributes and inline content.
2019-11-07DocBook reader: Fix bug with entities in mathphrase element.John MacFarlane1-0/+20
Closes #5885.
2019-11-07Change merge behavior for metadata.John MacFarlane1-1/+1
Previously, if a document contained two YAML metadata blocks that set the same field, the conflict would be resolved in favor of the first. Now it is resolved in favor of the second (due to a change in pandoc-types). This makes the behavior more uniform with other things in pandoc (such as reference links and `--metadata-file`).
2019-11-03Place caption before table in OpenDocument format. (#5869)Dmitry Pogodin1-4/+4
Closes #5681.
2019-11-02LaTeX reader: Fixed dollar-math parsing...John MacFarlane1-0/+8
...to ensure that space is left between a control seq and a following word that would otherwise change its meaning. Closes #5836.
2019-11-02Add test for #5836.John MacFarlane1-0/+19
2019-11-02Test for macro definitions in LaTeX preamble.John MacFarlane1-0/+16
2019-11-02Add test case for #5845.John MacFarlane1-0/+16
2019-10-29T.P.W.Shared: Changed gridTables so it does better at...John MacFarlane1-6/+6
...keeping the widths of columns. See #4320. Adjust test case for #4320.
2019-10-29Shared.makeSections: better behavior in some corner cases.John MacFarlane1-0/+170
When a div surrounds multiple sections at the same level, or a section of highre level followed by one of lower level, then we just leave it as a div and create a new div for the section. Closes #5846, closes #5761.
2019-10-28Shared: improve isTight.John MacFarlane1-0/+11
If a list has an empty item, this should not count against its being a tight list. Closes #5857.
2019-10-16Add support for reading & writing <mark> elementsFlorian B1-0/+20
Parse <mark> elements from HTML as HTML span like elements, with a single class matching the tag name `mark`. Mark elements are rendered to HTML using the native <mark> element. Fixes https://github.com/jgm/pandoc/issues/5797.
2019-10-15Add support for reading and writing <kbd> elementsDaniele D'Orazio1-0/+20
* Text.Pandoc.Shared: export `htmlSpanLikeElements` [API change] This commit also introduces a mapping of HTML span like elements that are internally represented as a Span with a single class, but that are converted back to the original element by the html writer. As of now, only the kbd element is handled this way. Ideally these elements should be handled as plain AST values, but since that would be a breaking change with a large impact, we revert to this stop-gap solution. Fixes https://github.com/jgm/pandoc/issues/5796.
2019-10-11Fix `gfm_auto_identifiers` behavior with emojis.John MacFarlane1-0/+6
Closes #5813. Note that we also now use emoji names for emojis when `ascii_identifiers` is enabled.
2019-10-11Markdown writer: prefer pipe_tables to raw html...John MacFarlane1-21/+3
...even when we must lose width information. All in all this seems to be people's preferred behavior, even though it is slightly lossier. Closes #2608. Closes #4497.
2019-10-10`--metadata-file`: when multiple files specified, second takes precedence...John MacFarlane2-2/+2
on conflicting fields. This changes earlier behavior (but not in a release), where first took precedence. Note that this may seem inconsistent with the behavior of multiple YAML blocks within a document, where the first takes precedence. Still, it is convenient to be able to override defaults with options later on the command line.
2019-10-10Make some writers sensitive to 'unlisted' class on headings.John MacFarlane1-0/+18
If this is present on a heading with the 'unnumbered' class, the heading won't appear in the TOC. This class has no effect if 'unnumbered' is not also specified. This affects HTML-based writers (including slide shows and epub), LateX (including beamer), RTF, and PowerPoint. Other writers do not yet support `unlisted`. Closes #1762.
2019-10-09RST writer: proper handling of :align: on figures, images.John MacFarlane1-0/+22
When the image has the `align-right` (etc.) class, we now use an `:align:` attribute. Closes #4420.
2019-09-24odt: Add external option for native numberingNils Carlson2-0/+78
This adds an external options +native_numbering to the ODT writer enabling enumeration of figures and tables in ODT output.
2019-09-22Improve test #5753John MacFarlane1-2/+2
2019-09-22RST reader: Fixed parsing of indented blocks.John MacFarlane1-0/+15
We were requiring consistent indentation, but this isn't required by RST, as long as each nonblank line of the block has *some* indentation. Closes #5753.
2019-09-22Make `plain` output plainer.John MacFarlane1-1/+1
Previously we used the following Project Gutenberg conventions for plain output: - extra space before and after level 1 and 2 headings - all-caps for strong emphasis `LIKE THIS` - underscores surrounding regular emphasis `_like this_` This commit makes `plain` output plainer. Strong and Emph inlines are rendered without special formatting. Headings are also rendered without special formatting, and with only one blank line following. To restore the former behavior, use `-t plain+gutenberg`. API change: Add `Ext_gutenberg` constructor to `Extension`. See #5741.
2019-09-19Remove admonition-title remnants.John MacFarlane1-1/+1
Completes 8e01ccb41dde8a5e6123f5b0746c36f240576047
2019-09-10Add --shift-heading-level-by option.John MacFarlane1-0/+33
Deprecate --base-heading-level. The new option does everything the old one does, but also allows negative shifts. It also promotes the document metadata (if not null) to a level-1 heading with a +1 shift, and demotes an initial level-1 heading to document metadata with a -1 shift. This supports converting documents that use an initial level-1 heading for the document title. Closes #5615.
2019-09-09LaTeX reader: Fix parsing of optional arguments that contain braced text.John MacFarlane1-0/+9
Closes #5740.
2019-09-08Org reader: modify handling of example blocks. (#5717)Brian Leung1-0/+60
* Org reader: allow the `-i` switch to ignore leading spaces. * Org reader: handle awkwardly-aligned code blocks within lists. Code blocks in Org lists must have their #+BEGIN_ aligned in a reasonable way, but their other components can be positioned otherwise.
2019-09-08Replace Element and makeHierarchical with makeSections.John MacFarlane4-12/+2
Text.Pandoc.Shared: + Remove `Element` type [API change] + Remove `makeHierarchicalize` [API change] + Add `makeSections` [API change] + Export `deLink` [API change] Now that we have Divs, we can use them to represent the structure of sections, and we don't need a special Element type. `makeSections` reorganizes a block list, adding Divs with class `section` around sections, and adding numbering if needed. This change also fixes some longstanding issues recognizing section structure when the document contains Divs. Closes #3057, see also #997. All writers have been changed to use `makeSections`. Note that in the process we have reverted the change c1d058aeb1c6a331a2cc22786ffaab17f7118ccd made in response to #5168, which I'm not completely sure was a good idea. Lua modules have also been adjusted accordingly. Existing lua filters that use `hierarchicalize` will need to be rewritten to use `make_sections`.
2019-09-08Revert changes to hierarchicalizeWithIds.John MacFarlane1-56/+0
Revert "hierarchicalize: ensure that sections get ids..." This reverts commit 212406a61d027d85712705e626954e0486a2bc34. Revert "Improve detection of headings in Divs by hierarchicalize." This reverts commit 6e2cfd6c97b1b8657f1f3e2b66090a2c3ba8d887. Revert "Shared.hierarchicalize: improve handling of div and section structure." This reverts commit 345b33762eb4cc6d57d74c76c4757a6166ee5c13.
2019-09-06hierarchicalize: ensure that sections get ids...John MacFarlane1-5/+5
even if they're in divs. Improves #3057.
2019-09-06Improve detection of headings in Divs by hierarchicalize.John MacFarlane1-5/+7
The structure ``` <h1>one</h1> <div> <h1>two</h1> </div> ``` should create two coordinate sections, not a section with a subsection. Now it does. Extends #3057.
2019-09-05Shared.hierarchicalize: improve handling of div and section structure.John MacFarlane1-0/+54
Previously Divs were opaque to hierarchicalize, so headings inside divs didn't get into the table of contents, for example (#3057). Now hierarchicalize treats Divs as sections when appropriate. For example, these structures both yield a section and a subsection: ``` html <div> <h1>one</h1> <div> <h2>two</h2> </div> </div> ``` ``` html <div> <h1>one</h1> <div> <h1>two</h1> </div> </div> ``` Note that ``` html <h1>one</h1> <div> <h2>two</h2> </div> <h1>three</h1> ``` gets parsed as the structure one two three which may not always be desirable. Closes #3057.
2019-09-04Roff readers: better parsing of groups.John MacFarlane1-0/+7
We now allow groups where the closing `\\}` isn't at the beginning of a line. Closes #5410.
2019-09-03XML: change toEntities to emit numerical hex character references.John MacFarlane1-3/+3
Previously decimal references were used. But Polyglot Markup prefers hex. See #5718. This affects the output of pandoc with `--ascii`.
2019-09-02LaTeX reader: don't try to parse includes if raw_tex is set.John MacFarlane1-5/+2
When the `raw_tex` extension is set, we just carry through `\usepackage`, `\input`, etc. verbatim as raw LaTeX. Closes #5673.
2019-09-02HTML writer: use numeric character references with `--ascii`.John MacFarlane1-1/+1
Previously we used named character references with html5 output. But these aren't valid XML, and we aim to produce html5 that is also valid XHTML (polyglot markup). (This is also needed for epub3.) Closes #5718.
2019-09-02LaTeX reader: properly handle optional arguments for macros.John MacFarlane1-0/+8
Closes #5682.
2019-08-27LaTeX reader: fix `\\` in `\parbox` inside a table cell.John MacFarlane1-0/+13
Closes #5711.