Commit Graph
920 Commits
Author SHA1 Message Date
Brian Leung 2dde57569a Org reader: allow example lines to end immediately after the colon
See the regexp at https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp/org-element.el?h=d1e4b9351941aa9241ab3aa0a34256376b7eca94#n2420.
2023-08-18 10:00:49 -07:00
John MacFarlane cbb33fefb7 LaTeX writer: Improve escaping of URIs in href, url.
Closes #8992.
2023-08-09 12:09:41 -07:00
John MacFarlane e611edb7d8 HTML reader: avoid duplicate id on header and div.
Closes #8991.
2023-08-09 11:36:32 -07:00
John MacFarlane e87addb58f HTML reader: properly calculate RowHeadColumns.
The previous algorithm did not handle rowspans; this one does.
Closes #8984.
2023-08-05 23:00:14 -07:00
John MacFarlane 0beab6345f Add test for #8984. 2023-08-05 11:57:31 -07:00
John MacFarlane 1d62883e14 HTML reader: require unanimity for RowHeadColumns.
Previously we used the max.  #8634 switched to the min, but this
had bad results.  This commit sets the RowHeadColumns to the consensus
value from all rows, or 0 if there is no consensus.

See #8984.
2023-08-05 11:48:29 -07:00
John MacFarlane acbc382ff4 Revert "Update #8764 command test for latest change to HTML table parser (#8634)."
This reverts commit 52d352a5ae.
2023-08-05 11:16:10 -07:00
John MacFarlane 0873895416 OpenDocument writer: implement syntax highlighting.
Still unimplemented: global background colors, line numbers.

Closes #6710, obsoletes #6717.
2023-08-04 20:43:39 -07:00
John MacFarlane 5e1b9591e1 Started implementing syntax highlighting for ODT.
Currently only colors are supported, not other text styles.

This change includes a new default opendocumnet template.

See #6710.
2023-08-04 13:31:06 -07:00
John MacFarlane 7b8e8f6f52 SelfContained: retain attributes in svg tag...
when referring to another svg's content using `<use>`.
Closes #8969.
2023-07-27 09:56:56 -06:00
John MacFarlane ecb59e1cde SelfContained: fix calculation of svg width and height.
We were computing width and height from viewBox incorrectly.
See #8969.
2023-07-26 09:49:37 -06:00
John MacFarlane 704a07d963 SelfContained: Improve inline SVGs.
- Ensure that width and height attributes don't get specified
  twice is both the img tag and the svg include them.
- Omit unnecessary attributes xmlns, xmlns:xlink, and version on
  svg element.
- Use 20 character rather than 40 character hashes for generated IDs.

Closes #8965.
2023-07-25 23:24:43 -06:00
John MacFarlane 77e01242da Typst writer: escape //.
So it doesn't get interpreted as a comment.

Closes #8966.
2023-07-25 09:23:16 -06:00
John MacFarlane ce2b023e13 Refine command line option preprocessor and add tests for #8956.
The substantive change here is the `-strue` will now work
instead of being interpreted as `-s -true`.

This is somewhat ad hoc, but I don't think we'll ever have
an output format named `rue`, so it's probably okay.
2023-07-19 15:21:39 -07:00
John MacFarlane b411aa4085 Add test for #8956. 2023-07-19 15:03:38 -07:00
John MacFarlane a97b270b28 Fix bugs in implementation of #8948. 2023-07-13 07:49:13 -07:00
John MacFarlane 29c5afb305 RST writer: fix figure handling.
This fixes a number of regressions from pandoc 2.x.

Properly handle caption, alt attribute in figures.

No longer treat a paragraph with a single image in it as a figure
(we have a dedicated Figure element now).

Closes #8930, closes #8871.
2023-07-12 09:13:32 -07:00
John MacFarlane 94832af98a SelfContained: Use inline svg instead of data uris...
for SVG images in HTML5. Closes #8948.

Note that SelfContained does not have access to the writer
name, so we check for HTML5 by determining whether the document
starts with `<DOCTYPE! html>`. This means that inline SVG
won't be used when generating document fragments.

An API change could be contemplated to give more flexibility,
but this is okay for now.
2023-07-11 10:59:33 -07:00
John MacFarlane adba9d460c Make modern AsciiDoc the target for asciidoc.
The AsciiDoc community now regards the dialect parsed by `asciidoctor`
as the official AsciiDoc syntax, so it should be the target of our
`asciidoc` format.

Closes #8936.

The `asciidoc` output format now behaves like `asciidoctor` used to.
`asciidoctor` is a deprecated synonynm. For the old `asciidoc` behavior
(targeting the Python script), use `asciidoc_legacy`.

The templates have been consolidated. Instead of separate
`default.asciidoctor` and `default.asciidoc` templates, there is
just `default.asciidoc`.

Text.Pandoc.Writers.AsciiDoc API changes:

- `writeAsciiDoc` now behaves like `writeAsciiDoctor` used to.
- `writeAsciiDoctor` is now a deprecated synonym for `writeAsciiDoc`.
- New exported function `writeAsciiDocLegacy` behaves like
  `writeAsciDoc` used to.
2023-07-05 09:10:36 -07:00
John MacFarlane 52d352a5ae Update #8764 command test for latest change to HTML table parser (#8634). 2023-06-24 11:21:51 -07:00
Albert Krewinkel cce347eaf5 LaTeX reader: support alt text on images. (#8745)
Closes: #8743
2023-06-22 10:46:56 -07:00
John MacFarlane 725ec09a10 Make implicit_figures work again in commonmark reader.
Support for this (introduced in #6350) disappeared when we made an
architectural change.
2023-06-19 11:18:30 -07:00
John MacFarlane 7b4eb40737 Parse references title from ref-list in JATS reader.
Closes #8365.
2023-06-07 13:36:58 -07:00
John MacFarlane 4f440583a8 JATS writer: include title in ref-list.
Previously the reference title ended up in a separate
section at the back of the body instead of in the ref-list
in the back matter.

Closes #8364.
2023-06-07 13:18:20 -07:00
John MacFarlane 46a4e24d6b Add typst reader.
New module Text.Pandoc.Readers.Typst [API change].
2023-06-06 16:08:14 -07:00
Albert Krewinkel f9bbbf6f40 Markdown reader: disallow escaping of ~ and " in markdown_strict
This matches the behavior of the legacy `markdown.pl` as well as what is
described in the manual.

Fixes: #8777
2023-05-04 11:52:04 +02:00
Albert Krewinkel 05a23af76d LaTeX reader: ignore args to column type in \multicolumn.
The `\multicolumn` command takes the column type as the second argument.
Types like `p` take an additional argument, which is now ignored and no
longer causes the table parser to fail.

Fixes: #8789
2023-05-04 11:36:10 +02:00
Michael Stahl 737446f33d Writers.OpenDocument: handle row header column cells as header cells
The previous commit prevented header column cells from being dropped on
the floor, this one changes the paragraph style to "Table_20_Heading".

Note that for the test input, the result is not correct: the
AnnotatedTable type cannot represent the HTML input properly, as it only
has a concept of header rows and header columns, but HTML can have an
individual cell that is a header (not 100% sure but they way i read
https://html.spec.whatwg.org/#header-and-data-cell-semantics the <th>
cell here is both a row header cell and a column header cell while the
other cells in the row and column are not header cells), and header
cells may even appear "in the middle" of a table (see example in
https://html.spec.whatwg.org/#the-th-element).

So while this appears like it's the right thing to do for
Writer.OpenDocument, it's not clear if this is going to make things
better or worse overall.

Fixes: #8764
2023-05-01 20:55:37 -07:00
Michael Stahl 2881c12740 Writers.OpenDocument: handle row header column cells as ordinary cells
While ODF 1.3 part 3 does specify a 9.1.11 <table:table-header-columns>
element, in practice it's only implemented by spreadsheet applications,
not word processors.

So simply treat the row header columns as ordinary table columns, at
least they don't get lost then.

Fixes: #8764
2023-05-01 20:55:37 -07:00
Michael Stahl 013351f602 Writers.OpenDocument: fix invalid text:p inside text:p from meta
The only element in meta for which data/templates/default.opendocument
allows block element content appears to be "abstract", which is already
filtered out of meta' at this point, so simply convert all blocks to
linebreak-separated inlines.

Fixes: #8256
2023-05-01 20:39:47 -07:00
Michael Stahl f3e1d33ea0 Writers.ODT: stop validator complaints by producing ODF 1.3
The ODF validator complains about an invalid attribute
style:contextual-spacing in styles.xml, ultimately an implementation
error in whatever old version of LibreOffice that produced the
data/odt/styles.xml (should have put it into an extension namespace).

Fortunately the attribute was added to ODF 1.3, which was released a
couple years ago.

So the easiest fix is to simply produce ODF 1.3 instead of 1.2; it's
supposed to be fully backward compatible.
2023-04-28 12:17:22 -07:00
wgevaertandWout Gevaert fd0f7332ed Remove links from inside links in mediawiki writer (#8739)
Co-authored-by: Wout Gevaert <wout@wikibase.nl>
2023-04-05 08:03:46 -07:00
Albert Krewinkel ef16a88cde Org reader: require abstract environment to use lowercase 2023-04-01 17:46:08 +02:00
Albert Krewinkel 96c2ad7d49 HTML writer: use first paragraph in task item as checkbox label.
Closes: #8729
2023-03-29 19:13:39 +02:00
John MacFarlane 9919d62df2 Moved a misplaced command test. 2023-03-26 11:09:58 -07:00
John MacFarlane b5d54f7f38 HTML reader: fix behavior with -native_spans-raw_html.
Previously with this configuration, `<span>`s were not treated
as inline elements at all.

Closes #8711.
2023-03-20 19:42:43 -07:00
John MacFarlane 1bfab1d11e HTML writer footnotes changes:
When `--reference-location=section` or `=block`, use an
`aside` element for the notes rather than a `section`.

When `--reference-location=section`, include the `aside`
element inside the section element, rather than outside.
(In slide shows, this option causes footnotes on a slide
to be displayed at the bottom of the slide.)

Closes #8695.
2023-03-14 21:49:05 -07:00
Albert Krewinkel 51750d6d9a Jira reader: add panel title as nested div
The title of a jira panel is added in a nested div as the first element
of the div panel.

Fixes: #8681
2023-03-13 17:31:12 +01:00
John MacFarlane 118dd92232 JATS reader: avoid generating duplicate figure captions.
Closes #8669.
2023-03-05 12:44:44 -08:00
John MacFarlane 8898c5336d Asciidoc writer: Properly escape | in table cells.
Closes #8665.
2023-03-03 18:14:06 -08:00
John MacFarlane 6b906879af Make sure TSV reader doesn't gobble tabs as whitespace.
Closes #8661.
2023-03-01 09:25:31 -08:00
Albert Krewinkel c8147fc583 Org reader: accept empty tables
Fixes: #8659
2023-03-01 12:20:47 +01:00
John MacFarlane b81ead43e0 RST reader: align with spec in syntax for role names.
In particular, we now allow colons in row names.

Closes #8653.
2023-02-24 09:55:25 -08:00
Albert Krewinkel 0088b776bc LaTeX writer: do not use longtable foot with Beamer
The table foot is made part of the table body, as otherwise it won't
show up in the output. The root cause for this is that longtable cannot
detect page breaks in Beamer.

Fixes: #8638
2023-02-22 09:26:26 +01:00
Albert Krewinkel d08d1c04c5 JATS writer: include alt-text in <graphic>, <inline-graphic> elements
Closes: #8631
2023-02-18 00:09:21 +01:00
John MacFarlane 6c934abe6d Citeproc: Fix bug in metaValueToReference.
This bug caused us to get some repeated content when converting
MetaBlock to Inlines.  Closes #8611.
2023-02-09 20:02:39 -08:00
John MacFarlane 1a7146ba70 Handle % in biblatex doi field.
Closes #8595.
2023-02-01 14:20:05 -08:00
John MacFarlane 58dfc3115a Add some diagnostics to newif test. 2023-02-01 09:17:45 -08:00
John MacFarlane 23178ec96e LaTeX reader: Fix bug in macro resolution for environments.
This is a regression in pandoc 3.0 that affects environments
with arguments.  Closes #8573.
2023-01-23 12:48:49 -08:00
John MacFarlane 6ebabd2118 HTML writer: don't omit newlines in task lists. 2023-01-20 10:29:40 -08:00