Commit Graph
7972 Commits
Author SHA1 Message Date
Albert Krewinkel dfbfbfbf24 Parsing.GridTable: remove use of unsafe function last 2022-07-18 12:14:54 +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
Albert Krewinkel daef24f022 Lua: extend pandoc.system module. (#8184)
The module now has the additional functions `list_directory`,
`make_directory`, and `remove_directory`. This makes it easier to write
cross-platform scripts that need to inspect or modify the file system.
2022-07-15 21:22:33 +02:00
Albert Krewinkel 12cc140272 Lua: add fields pandoc.readers and pandoc.writers. (#8177)
The set of supported input and output formats is made available to Lua
users.
2022-07-12 20:14:42 +02:00
John MacFarlane c7f5fd2400 RST writer: always escape literal backslash.
Previously we didn't escape it when it is word-internal,
but that seems wrong.  See #8178.
2022-07-12 20:11:05 +02:00
John MacFarlane cf57a8344a Fix roff ms syntax highlighting definitions.
Begin each string definition with `\&`.
Closes #8175. Thanks to Branden Robinson.
2022-07-11 23:58: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
John MacFarlane c1ccbc553f PDF: use sha1 hash of filename when converting svg.
The previous code threw away the directory component of
the filename in constructing a new one. This led to
surprising results if you had e.g. `foo/pic.svg` and `bar/pic.svg`;
in the final PDF they'd be the same image, because the latter
would overwrite the former in the temp directory.
2022-06-24 17:52:39 -07:00
Albert Krewinkel 6d351df1ed Lua: ensure that tables marshaled via JSON arrays behave like Lists.
This allows to invoke methods like `map` and `includes` on lists like
`PANDOC_WRITER_OPTIONS.extensions`.
2022-06-23 22:53:11 +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
Albert Krewinkel f49bee5c31 ConTeXt writer: support complex table structures. (#8116)
The following table feature are now supported in ConTeXt:

- colspans,
- rowspans,
- multiple bodies,
- row headers, and
- multi-row table head and foot.

The wrapping `placetable` environment is also given a `reference` option
with the table identifier, enabling referencing of the table from within
the document.
2022-06-21 10:22:34 -07:00
Gabriel Lewertowski ab712246f0 Update fonts MIME following IANA recommendation (#8127) 2022-06-21 10:21:34 -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
Georgi Lyubenov a21d6e9fa6 Future compat against liftA2 export from Prelude (#8132) 2022-06-19 12:36:21 -07:00
Amir Dekel 5fe154deb2 Org reader: Fix Post / Pre mixup when setting emphasis chars (#8134) 2022-06-19 19:52:56 +02:00
Albert Krewinkel f39eeba35f Lua: do not reset foreign encoding before running Lua
This was a leftover from previous hslua versions that relied heavily on
`Foreign.C.withCString` and the like. However, hslua 2 and later use
bytestring functions to retrieve string values, so this is no longer
needed.
2022-06-19 14:33:33 +02:00
John MacFarlane a6344893b0 Use dev version of citeproc. 2022-06-15 10:52:26 -06:00
Elliot Bobrow 6ff4972ca9 add --embed-resources flag (#8121)
* Add `--embed-resources` flag for `--self-contained` without implying
  `--standalone`
* Deprecate `--self-contained flag`

Closes #7331
2022-06-14 17:00:18 -06: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
Wentao Han 8197ae00b8 LaTeX writer: Extend list of book documentclasses (#8053) 2022-06-10 08:42:14 -07:00
Albert Krewinkel 42cbc71bbc Allow placing custom readers and writers in data subdir (#8112)
* PandocMonad: add new function `findFileWithDataFallback` [API Change]
* Custom readers: allow files to be placed in "readers" data dir
* Custom writers: allow files to be placed in "writers" data dir
2022-06-10 08:37:12 -07:00
Albert Krewinkel 2200b9c8ff TikiWiki: support underlined text 2022-06-10 11:29:00 +02:00
Albert Krewinkel 7e6ccda6d9 Lua: use only old ByteString functions.
The function `takeWhileEnd` was added with bytestring-0.11.3.0, but older
versions should be supported as well.

Fixes the previous commit.
2022-06-09 08:54:06 +02:00
Albert Krewinkel b3cee8bdb0 Lua: Simplify module loading code.
Modules are now loaded directly; the special pandoc Lua package searcher
is no longer necessary and has been removed.
2022-06-08 22:45:28 +02:00
YI 665d5b0fbd org reader: recognize {webp,jxl} files as images 2022-06-08 12:29:50 +02:00
Albert Krewinkel b2b21bb4c5 Lua: add function pandoc.mediabag.fill (#8104)
The function allows to fill the mediabag with all images in a given
document. Images that cannot be fetched are replaced with a Span
containing the image description.
2022-06-06 09:25:09 -07: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
Albert Krewinkel 9d268e56ed ConTeXt writer: unify link handling (#8096)
Autolinks, i.e. links with content that's the same as the linked URL,
are now marked with the `\url` command. All other links, both internal
and external, are created with the `\goto` command, leading to shorter,
slightly more idiomatic code. As before, autolinks can still be styled
via `\setupurl`, other links via `\setupinteraction`.
2022-06-04 21:49:53 -07:00
Albert Krewinkel cc2849ccd0 Docx writer: prevent crashing when handling invalid tables
Tables with different numbers of cells per row would sometimes crash
pandoc. This fix prevents this by cutting off overlong rows.

Fixes: #8102
2022-06-05 00:00:51 +02: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
John MacFarlane e8be78f91a Fix treatment of extensions for \input in LaTeX reader.
Previously we required a `.tex` extension, but TeX
allows any extension for `\input` (as opposed to `\include`).

Closes #8092.
2022-06-01 09:07:47 -07:00
Albert Krewinkel 30b3e0a9d6 LaTeX writer: fix width of multicolumn cells.
Cells spanning multiple columns must be given an explicit width,
calculated from the table properties.

Fixes: #8090
2022-06-01 11:04:31 +02:00
John MacFarlane bd13077ce0 JATS reader: support edition in references.
Closes #8087.
Note: we strip off any non-digits, since CSL wants "4" rather
than "4th ed."
2022-05-31 12:01:15 -07:00
Brian Leung ae8ed408b0 Org reader: support line selection in INCLUDE directives. (#8060) 2022-05-20 09:46:16 +02:00
John MacFarlane ed054b4c74 Add tex_math_dollars to gfm default extensions. 2022-05-19 16:36:21 -07:00
John MacFarlane 4cbf4f6489 Beamer: allow containsverbatim as alternative to fragile.
Closes #8080.
2022-05-19 09:56:57 -07:00
John MacFarlane b8fb79b5c0 ICML writer: support custom-style attribute on Table.
Closes #8079.
2022-05-18 09:55:22 -07:00
John MacFarlane 6eb77586b4 Docx writer: add w:lang to rPr for Span and Div with lang attribute.
So that Word can know that "Apfel" is not a spelling error.
Closes #8026.
2022-05-16 17:56:43 -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 1906ae0548 Asciidoc writer: fix underline.
We were rendering it as `+++text+++`; this is now changed to
`[.underline]#text#`.  See comment at
<https://github.com/jgm/pandoc/issues/8070#issuecomment-1126883824>.
2022-05-15 14:30:30 -07:00
Jaehwang Jung 9c85933b38 Allow environment variable interpolation in highlight-style in defaults files (#8073) 2022-05-14 15:17:41 -07:00
Frerich Raabe b888a8c77e Improved reading <xref> elements in DocBook files (#8065)
<xref> elements can also be used to link to <figure> elements. Alas, the
DocBook reader was not aware of this and thus generated a link text
which just said 'figure_title'.

https://tdg.docbook.org/tdg/4.5/figure.html explains that <figure>
elements can contain <title> elements, so let's try to use that if it is
available.
2022-05-11 19:07:03 -07:00
John MacFarlane b0195b7ef4 Allow environment variable interpolation in pdf-engine...
in defaults files.  Note that pdf-engine can take an absolute
path, so this is useful.

See #8061.
2022-05-11 09:15:26 -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