aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2019-10-30docbook reader: fix nesting of chapters and sections (#5864)Florian Klink3-0/+49
* Set dbBook to true when traversing a chapter too. Currently, a `<title/>` in a chapter and in a `<section/>` below that chapter have the same level if they're not inside a `<book/>`. This can happen in a multi-file book project. Also see the example at https://tdg.docbook.org/tdg/4.5/chapter.html Co-authored-by: Félix Baylac-Jacqué <felix@alternativebit.fr> * Add docbook-chapter test This tests nested `<section/>` and makes sure `<title/>` in the first `<section/>` below `<chapter/>` is one level deeper than the `<chapter/>`'s `<title/>`, also when not inside a `<book/>`. Co-authored-by: Félix Baylac-Jacqué <felix@alternativebit.fr>
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-29Changes to build with new doctemplates/doclayout.John MacFarlane2-2/+1
The new version of doctemplates adds many features to pandoc's templating system, while remaining backwards-compatible. New features include partials and filters. Using template filters, one can lay out data in enumerated lists and tables. Templates are now layout-sensitive: so, for example, if a text with soft line breaks is interpolated near the end of a line, the text will break and wrap naturally. This makes the templating system much more suitable for programatically generating markdown or other plain-text files from metadata.
2019-10-29Remove include of grffile from default latex template.John MacFarlane1-1/+1
This package is needed for proper handling of image filenames containing periods (in addition to the period before the extension). Unfortunately, grffile breaks in the latest texlive update. Until a fix is released (see ho-tex/oberdiek#73) it seems best to remove this from the default template. This may cause problems if you have filenames with periods. The workaround is to put `\usepackage{grffile}` in header-includes, and be sure you're using an older version of texlive packages. See #5848. We will leave that issue open to remind us to check upstream, and restore grffile when it's possible to do so.
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-27Org reader: fix parsing of empty comment linesAlbert Krewinkel1-1/+11
Comment lines in Org-mode can be completely empty; both of these line should produce no output: # a comment # The reader used to produce a wrong result for the latter, but ignores that line as well now. Fixes: #5856
2019-10-24HTML reader/writer: Better handling of <q> with cite attribute (#5837)Ole Martin Ruud3-0/+25
* HTML reader: Handle cite attribute for quotes. If a `<q>` tag has a `cite` attribute, we interpret it as a Quoted element with an inner Span. Closes #5798 * Refactor url canonicalization into a helper function * Modify HTML writer to handle quote with cite. [0]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/q
2019-10-23Add Reader support for HTML <samp> element (#5843)Amogh Rathore1-0/+6
The `<samp>` element is parsed as a Span with class `sample`. Closes #5792.
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-15Muse reader: do not allow closing asterisks to be followed by "*"Alexander Krotov1-3/+23
2019-10-14Minor template & test changes for latest dev doctemplates.John MacFarlane1-2/+2
2019-10-15Muse reader: do not split series of asterisks into symbols and emphasisAlexander Krotov1-0/+8
Fixes #5821
2019-10-15Muse reader: do not terminate emphasis on "*" not followed by spaceAlexander Krotov1-0/+4
2019-10-12LaTeX writer: fix horizontal rule.John MacFarlane1-13/+13
We change to use 0.5pt rather than `\linethickness`, which apparently only ever worked "by accident" and no longer works with recent updates to texlive. Closes #5801.
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-10-09Update s5 test for mathjax 3 change.John MacFarlane1-1/+1
2019-10-09Options.WriterOptions: Change type of writerVariables to Context Text.John MacFarlane1-1/+5
This will allow structured values. [API change]
2019-10-04hlint Muse reader testsAlexander Krotov1-1/+1
2019-10-03Minor ghc 8.8 fixups.John MacFarlane1-1/+0
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-23Man writer: suppress non-absolute link URLs.John MacFarlane1-22/+22
Motivation: in a man page there's not much use for relative URLs, which you can't follow. Absolute URLs are still useful. We previously suppressed relative URLs starting with '#' (purely internal links), but it makes sense to go a bit farther. Closes #5770.
2019-09-23ConTeXt unit tests - tweak code property.John MacFarlane1-1/+1
Inline code will never have two consecutive newlines. We get a counterexample in this case https://pipelines.actions.githubusercontent.com/bMXCpShstkkHbFPgw9hBRMWw2w9plyzdVM8r7CRPFBHFvidaAG/5cf52d2d-3804-412d-ae65-4f8c059b0fb7/_apis/pipelines/1/runs/116/signedlogcontent/39?urlExpires=2019-09-23T17%3A38%3A05.8358735Z&urlSigningMethod=HMACV1&urlSignature=Qtd6vnzqgSwXpAkIyp9DJY4Kn7GJzYMR8UDkLR%2FsMQY%3D so for simplicity we just weed out code with newlines.
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 MacFarlane3-91/+39
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-21[Docx Reader] Update testsNikolay Yakimov6-7/+7
Notice this commit updates lists.docx. The old test file contained references to "ListParagraph" style, which should never leak outside of pandoc, so I'm not sure what that was supposed to test for exactly.
2019-09-21[Docx Reader] Use style names, not ids, for assigning semantic meaningNikolay Yakimov5-0/+19
Motivating issues: #5523, #5052, #5074 Style name comparisons are case-insensitive, since those are case-insensitive in Word. w:styleId will be used as style name if w:name is missing (this should only happen for malformed docx and is kept as a fallback to avoid failing altogether on malformed documents) Block quote detection code moved from Docx.Parser to Readers.Docx Code styles, i.e. "Source Code" and "Verbatim Char" now honor style inheritance Docx Reader now honours "Compact" style (used in Pandoc-generated docx). The side-effect is that "Compact" style no longer shows up in docx+styles output. Styles inherited from "Compact" will still show up. Removed obsolete list-item style from divsToKeep. That didn't really do anything for a while now. Add newtypes to differentiate between style names, ids, and different style types (that is, paragraph and character styles) Since docx style names can have spaces in them, and pandoc-markdown classes can't, anywhere when style name is used as a class name, spaces are replaced with ASCII dashes `-`. Get rid of extraneous intermediate types, carrying styleId information. Instead, styleId is saved with other style data. Use RunStyle for inline style definitions only (lacking styleId and styleName); for Character Styles use CharStyle type (which is basicaly RunStyle with styleId and StyleName bolted onto it).
2019-09-20Preserve built-in styles in DOCX with custom style (#5670)Ben Steinberg4-0/+19
This commit prevents custom styles on divs and spans from overriding styles on certain elements inside them, like headings, blockquotes, and links. On those elements, the "native" style is required for the element to display correctly. This change also allows nesting of custom styles; in order to do so, it removes the default "Compact" style applied to Plain blocks, except when inside a table.
2019-09-19Remove admonition-title remnants.John MacFarlane1-1/+1
Completes 8e01ccb41dde8a5e6123f5b0746c36f240576047
2019-09-15Lua filters: allow passing of HTML-like tables instead of Attr (#5750)Albert Krewinkel1-0/+41
Attr values can now be given as normal Lua tables; this can be used as a convenient alternative to define Attr values, instead of constructing values with `pandoc.Attr`. Identifiers are taken from the *id* field, classes must be given as space separated words in the *class* field. All remaining fields are included as misc attributes. With this change, the following lines now create equal elements: pandoc.Span('test', {id = 'test', class = 'a b', check = 1}) pandoc.Span('test', pandoc.Attr('test', {'a','b'}, {check = 1})) This also works when using the *attr* setter: local span = pandoc.Span 'text' span.attr = {id = 'test', class = 'a b', check = 1} Furthermore, the *attributes* field of AST elements can now be a plain key-value table even when using the `attributes` accessor: local span = pandoc.Span 'test' span.attributes = {check = 1} -- works as expected now Closes: #5744
2019-09-15Revert "FB2 reader test: better diagnostics on failure."John MacFarlane1-28/+1
This reverts commit c65af7d1a2f35cbfd1235df2960f7156d38e8f92.
2019-09-15FB2 reader test: better diagnostics on failure.John MacFarlane1-1/+28
2019-09-14FB2 reader test: Another attempt to fix test failure on GitHub CI.John MacFarlane1-4/+5
2019-09-13Revert "FB2 reader test: filter CRs."John MacFarlane1-2/+2
This reverts commit e35147d715a737bb854e0c527243f77d970d1b86.
2019-09-13FB2 reader test: filter CRs.John MacFarlane1-2/+2
This may help with the test failure on GitHub CI. https://github.com/jgm/pandoc/commit/b59e6d03762becd5c9d767463ce7ba5062a1b4a0/checks
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 MacFarlane7-22/+7
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-05Add div.hanging-indent CSS to HTML templates.John MacFarlane7-0/+7