Commit Graph
833 Commits
Author SHA1 Message Date
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
black-desk 2abf56f508 Remove extra soft break for tasklist (#8142)
Browser will display the extra newline character between checkbox and
text as a space, which make tasklist items cannot be aligned.

I just remove it.
2022-06-23 09:59:11 -07:00
John MacFarlane 3876f15b45 Ensure that metadata values w/o trailing newlines are...
parsed as inlines, as the manual states.

Previously, they were parsed as inlines if they would
otherwise have been a single Plain or Para, but otherwise
left unchanged.  This led to some quirky results (e.g. #8143).
We now use the general function `blocksToInlines` from T.P.Shared.
2022-06-22 23:09:51 -07:00
Elliot Bobrow f317ec41a1 LaTeX: Handle formatted text inside code inline (#8129)
Add `formatCode` function to Text.Pandoc.Shared [API change].

Use this in the LaTeX reader so that e.g.
`\texttt{\textbf{bold code}}` is parsed as `Strong [Code ("",[],[]) "bold code"]`.
2022-06-20 12:18:05 -07:00
John MacFarlane b263f38304 LaTeX reader: improve mathEnvWith.
When converting e.g. an align environment to an aligned environment
inside a Math element, we need to include a newline before the
`\end{aligned}`, since the previous line might end in a comment.

Closes #8122.
2022-06-13 23:14:51 -06:00
Albert Krewinkel e5c41f11de ConTeXt writer: use "sectionlevel" environment for headings (#8106)
The document hierarchy is now conveyed using the
`\startsectionlevel`/`\stopsectionlevel` by default. This makes it easy
to include pandoc-generated snippets in documents at arbitrary levels.
The more semantic environments "chapter", "section", "subsection", etc.
are used if the `--top-level-division` command line parameter is set to
a non-default value.

Closes: #5539
2022-06-06 09:24:28 -07:00
John MacFarlane ad845c0376 makeSections: don't make a section for a div with class "fragments".
Closes #8098.
2022-06-02 09:01:18 -07:00
John MacFarlane 98a1b921e3 HTML writer: fix bug with --number-offset.
This formerly caused section divs to be produced, even
when `--section-divs` was not specified.  Closes #8097.
2022-06-02 08:46:26 -07:00
John MacFarlane f53977e295 LaTeX writer: Improve grouping with autocites.
Closes #8088.
2022-06-01 23:24:49 -07:00
Brian Leung ae8ed408b0 Org reader: support line selection in INCLUDE directives. (#8060) 2022-05-20 09:46:16 +02:00
John MacFarlane b8fb79b5c0 ICML writer: support custom-style attribute on Table.
Closes #8079.
2022-05-18 09:55:22 -07:00
John MacFarlane 3df55b4a4a AsciiDoc writer: fix commas in link text.
Commas in link text trigger interpretation of attributes.
To block this, we replace them with numeric entities.

Closes #8070.
2022-05-16 16:45:05 -07:00
John MacFarlane 0b2adf9617 RIS reader: get right order of names.
Closes #8055.
2022-05-03 10:44:09 -07:00
Brian Leung 67daf96bdd Org reader: allow attrs for Org tables. (#8049)
Tables with attributes are no longer wrapped in Div elements;
attributes are added directly to the table element.
2022-05-02 17:25:57 +02:00
John MacFarlane c1105e6b06 HTML writer: avoid doubled style attribute...
when height and width are added to style because of an image,
but the image already has a style attribute.

Closes #8047.
2022-04-28 15:49:20 -07:00
John MacFarlane 50c9848c34 HTML writer: Add 'footnotes' identifier to footnotes section.
Closes #8043.
2022-04-26 13:03:02 -07:00