Commit Graph
848 Commits
Author SHA1 Message Date
John MacFarlane 91436ebbf4 T.P.Writers.Shared toTableOfContents: handle nested Divs better.
Closes #8402.
2022-10-27 12:46:59 -07:00
John MacFarlane 400d4e1387 LaTeX reader: parse short table caption.
See jgm/pandoc-types#103.

This is not too useful yet, because writers don't do anything with
the short caption.
2022-10-21 11:44:12 -07:00
John MacFarlane e3fd2d5a03 Revert "HTML reader: avoid duplicating any existing identifier..."
This reverts commit e5fbddd3b6.
2022-10-18 12:51:34 -07:00
John MacFarlane ff22116426 Revert "Markdown reader: avoid duplicate ids with auto_identifiers."
This reverts commit eff82cfe4d.
2022-10-18 12:51:12 -07:00
John MacFarlane eff82cfe4d Markdown reader: avoid duplicate ids with auto_identifiers.
We previously avoided generating a duplicate with another automatically
generated identifier; now we also avoid duplicates with explicit
identifiers that occur before the header for which an identifier
is being generated.  (Collisions are still possible for identifiers
that occur after the header.)

T.P.Shared: `makeSections` is also modified so it doesn't give
bad results when the enclosing Div has a different identifier
from the header, as may now happen.
2022-10-18 12:42:12 -07:00
John MacFarlane e5fbddd3b6 HTML reader: avoid duplicating any existing identifier...
with `auto_identifiers`.

Closes #8383.
2022-10-18 09:51:33 -07:00
John MacFarlane abb7aab75f RST writer: improve inline escaping rules.
Also a small performance optimization.

Closes #8380.
2022-10-16 14:59:28 -07:00
Albert Krewinkel 7b7a7d6742 LaTeX writer: add separator line between table's body and its foot.
The writer uses features from the longtable package to define the table
foot. Furthermore, the table's bottom rule is now part of the foot,
where it previously was given as part of the body.
2022-10-06 22:07:25 +02:00
John MacFarlane b05c380f6f HTML writer: replace deprecated aria roles for bibliography entries.
`doc-biblioentry` -> `listitem`
`doc-bibliography` -> `list`

Closes #8354.
2022-10-05 11:58:50 -07:00
John MacFarlane dd07d8002f JATS writer: use <break/> for LineBreak...
in the limited contexts that accept it.

Closes #8344.
2022-10-01 17:46:13 -07:00
Albert Krewinkel 5be9052f5f [API Change] Extract Lua code into new package pandoc-lua-engine
The flag 'lua53` must now be used with that package if pandoc is to be
compiled against Lua 5.3.
2022-09-30 08:33:40 -07:00
John MacFarlane 48d0bfc675 Add --list-tables option.
[API change] Add writerListTables to WriterOptions.

RST writer: Remove sensitivity to "list-table" class in table attributes.
Instead, just check `writerListTables` in writer options.

See #4564.
2022-09-29 10:20:58 -07:00
danse c974ed0cae rST writer: list tables rendering, closes #4564
When a table is marked with a "list-table" attribute class, it will
now be rendered using the list table syntax documented here
http://docutils.sourceforge.net/docs/ref/rst/directives.html#list-table
2022-09-29 09:56:00 -07:00
John MacFarlane bcf06e7f5e HTML writer: prevent <a> inside <a>.
If a link text contains a link, we replace it with a span.
See #7585.
2022-09-28 08:34:50 -07:00
Albert Krewinkel b38292c234 LaTeX writer: do not repeat caption on headless tables
The caption of headless tables was repeated on each page that contained
part of the table. It is now made part of the "first head", i.e. the
table head that is printed only once.
2022-09-21 12:03:41 +02:00
John MacFarlane f3e9669e84 Commonmark writer: ensure that we don't have blank lines in raw HTML.
Closes #8307.
2022-09-19 12:03:03 -07:00
John MacFarlane cfbf0f096b Org reader: Allow org-ref v2 citations with & prefix.
Closes #8302.
2022-09-19 10:30:44 -07:00
John MacFarlane c0ff59c272 BibTeX parser: fix handling of % in url field.
`%` does not function as a comment character inside `url`
(where URL-encoding is common).

Commit 6fb2973a58 mistakenly
took this reassignment of `%` to be a general feature of
braced (but not quoted) BibTeX fields.

This commit restores the correct behavior of `%` in braced fields
other than `url`, and corrects the behavior of `%` in `url`
when the value is quoted.

Closes #7678 (again).
2022-09-18 19:17:48 -07:00
John MacFarlane 311a340687 Add prefixes to identifiers with --file-scope. (#8282)
This change only affects the case where `--file-scope` is used
and more than one file is specified on the command line.

In this case, identifiers will be prefixed with a string
derived from the file path, to disambiguate them. For example,
an identifier `foo` in `contents/file1.txt` will become
`contents__file1.txt__foo`.  Links will be adjusted accordingly:
if `file2.txt` links to `file1.txt#foo`, then the link will
be changed to point to `#file1.txt__foo`.  Similarly, a link
to `file1.txt` will point to `#file1.txt`.  A Div with an
identifier derived from the file path will be added around
each file's content, so that links to files will still work.

Closes #6384.

[API change]: Text.Pandoc.Shared exports `textToIdentifier`.
2022-09-18 18:11:40 -07:00
John MacFarlane 35a3fb7e83 Citeproc: Require a digit for an implicit "page" locator...
inside explicit locator syntax `{...}`.

Previously a locator specified as `{}` would be rendered
as `p.` with nothing after it.

Closes #8288.
2022-09-09 10:30:01 -07:00
John MacFarlane 86a3467ece HTML writer: only treat . . . as a slide pause in slides...
...and not in regular HTML output.
Closes #8281.
2022-09-05 09:51:59 -07:00
Albert Krewinkel 635b6e3953 Use dev version of gridtables
This allows to specify a table foot by enclosing it with part separator
lines, i.e., row separator lines consisting only of `+` and `=`
characters. E.g.:

    +------+-------+
    | Item | Price |
    +======+=======+
    | Eggs | 5£    |
    +------+-------+
    | Spam | 3£    |
    +======+=======+
    | Sum  | 8£    |
    +======+=======+

The last row, containing "Sum" and "8£", is the table foot.

Closes: #8257
2022-09-01 09:06:42 +02:00
Ruqi 8b5fb50198 Mediawiki reader: Parse table cell with attribs, to support rowspan, colspan (#8231) 2022-08-30 09:51:09 +02:00
John MacFarlane 1d92024bcb HTML, Markdown writers: filter out empty class attributes.
These should not be generated by any pandoc readers, but they
might be produced programatically. Technically that's a misuse
of the AST, but since the expectation that the classes are
nonempty strigs is not encoded in the types, it can happen. This patch
limits the damage if it does, preventing invalid markdown attributes
like `{.}` from being written.

Cloess #8251.
2022-08-27 17:30:17 -07:00
Siphalor 8670f6dc5b Markdown reader: fenced code block shortcuts with attributes (#8174)
This allows the combination of the fenced code block shortcut form with
attributes:

````
```haskell {.class #id}
```
````

The code syntax class will be combined with the attribute classes.

This syntax allows for more intuitive writing and for better compatibility
with other Markdown parsers such as GitHub or Codeberg.

Closes #8174.
2022-08-25 10:18:11 -07:00
John MacFarlane 488ad80a20 LaTeX reader: handle ## macro arguments properly.
These turn into regular `#` arguments when expanded.

Closes #8243.
2022-08-24 09:36:13 -07:00
Albert Krewinkel 16d134218b HTML writer: revert to using width property for column widths
The default `flex` and `overflow-x` properties of a column are set to
`auto`. In combination, these changes allow to get good results when
using columns with or without explicit widths.
2022-08-22 15:32:39 +02:00
Albert Krewinkel 08f1f4551c Org writer: add support for jupyter nodebook cells.
Closes: #6367
2022-08-22 12:53:58 +02:00
luz paz aff726b460 Fix typos
Found via `codespell -q 3 -S changelog.md -L bu,fo,ist,mke,multline,noes,ot,pard,pres,tabl,te,tothe`
2022-08-21 20:23:00 -07:00
Albert Krewinkel 5d66166088 Org reader: treat *emacs-jupyter* src blocks as code cells.
This improves support for notebook-like org files that are intended to be used
with emacs-jupyter package.

Closes: #8236
2022-08-21 21:53:33 +02:00
Albert Krewinkel 0d19b859ce HTML writer: use flex property for column widths
Fixes: #8232
2022-08-18 11:20:42 +02:00
Albert Krewinkel f294acff38 Org reader: treat "abstract" block as metadata
A block of type "abstract" is assumed to define the document's abstract.
It is transferred from the main text to the metadata.

Closes: #8204
2022-08-17 16:49:37 +02:00
Albert Krewinkel 90d8205e17 Org template: add abstract from metadata as block of type "abstract"
See #8204.
2022-08-17 16:40:54 +02:00
Albert Krewinkel 81e31ee637 LaTeX writer: add label to tables that have an identifier
Tables with an identifier are marked with a `\label`. A caption is
always included in this case, even if the caption is empty.

Closes: #8219
2022-08-17 12:39:07 +02:00
Albert Krewinkel fc3b9e763f Use dev version of gridtables.
Closes: #8216
2022-08-05 13:48:30 +02:00
Albert Krewinkel 0d7f80c87f HTML reader: allow sublists that are not marked as items.
The HTML standard requires all list items to be marked with a `<li>`
tag, but some tools fail to do so for sublists. The reader now accepts
these unwrapped lists as sublists.

Closes: #8150
2022-08-03 15:00:35 +02:00
Albert Krewinkel b306f2e1fd Org reader: add missing / to Windows file URI; fixes prev commit 2022-08-03 09:51:13 +02:00
Albert Krewinkel 516c827d61 Org reader: recognize absolute paths on Windows
Fixes: #8201
2022-08-02 23:49:10 +02:00
Albert Krewinkel 7a4afce60c Markdown reader: allow special span classes in any position 2022-08-01 10:03:48 -07:00
Albert Krewinkel f4a7c0b799 Markdown reader: allow more attributes in special spans
Spans with "smallcaps" as the first class are converted to *SmallCaps*
elements. While previously no other classes or attributes were allowed,
additional classes, attributes, and an identifier are not permitted and
kept in a *SmallCaps* wrapping *Span* element.

The same change is applied to underline spans, where the first class
must be either "ul" or "underline".

Closes: #4102
2022-08-01 10:03:48 -07:00
John MacFarlane f637ccd3bf MediaWiki reader: allow HTML comment after row start.
Closes #8110.
2022-07-28 11:28:02 -07:00
John MacFarlane 5c3423f2e2 DokuWiki reader: support latex plugin and math.
The `tex_math_dollars` extension is now supported for `dokuwiki`
(but off by default).

Content inside `<latex>...</latex>` is parsed as raw LaTeX inline,
and inside `<LATEX>..</LATEX>` as raw LaTeX block.

In addition, this commit changes the behavior of `<php>...</php>` so
that instead of producing a code block, it produces raw HTML
with `<?php ... ?>`.

Closes #8178.
2022-07-28 11:28:02 -07:00
John MacFarlane ac7fa3da4d HTML writer: Allow "spanlike" classes to be combined.
Previously classes like "underline" and "marked" had to
be the first class in a span in order for the span to be
interpreted as a "ul" or "mark" element.  This commit allows
these special classes to be "stacked," e.g.
`[test]{.mark .underline}`; in addition, the special classes are no
longer required to come first in the list of classes.

See #8194 for context.
2022-07-25 11:55:48 -07:00
John MacFarlane b7bc980089 Test for #5795: remove redundant 'dfn' classes 2022-07-25 11:01:11 -07:00
John MacFarlane e90ce8e1ab Unescape characters in \lstinline inside \passthrough.
For full motivation, see #1629 ; this improves on
99e24cf183.

Closes #8179.
2022-07-18 19:52:33 +02:00
John MacFarlane 98fb8521a7 RST writer: Fix missing spaces with nested inlines.
Previously spaces around links inside italics were omitted.

Closes #8182.
2022-07-16 15:49:45 +02:00
John MacFarlane 9d256aa19b Use latest dev citeproc 2022-07-11 23:40:13 +02:00
John MacFarlane 56051c8ac3 RTF reader: support \nosupersub.
Closes #8170.
2022-07-07 22:56:29 +02:00
Elliot Bobrow 7fdc01ac0d Use formatCode from #7525 in HTML and MediaWiki (#8162)
Move formatting from inside inline code elements to the outside in order
to retain formatting.
2022-07-06 22:10:24 +02:00
John MacFarlane befa9d1301 Ensure that Nulls are ignored in creating slide shows.
Also ensure that Nulls are ignored in sectionification
by `makeSections`.

Closes #8155.
2022-07-04 14:34:14 +02:00