aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2022-09-22Split pandoc-server, pandoc-cli into separate packages.split-packagesJohn MacFarlane
This also removes the unnecessary Setup.hs from pandoc. Cabal does not need this with build-type 'simple'.
2022-09-21LaTeX writer: do not repeat caption on headless tablesAlbert Krewinkel
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-21LaTeX writer: clarify why `\endfirsthead` is used for tablesAlbert Krewinkel
2022-09-20Export `applyFilter` from T.P.Lua.Filter.John MacFarlane
Motivation: now we need not have any logic referring to hslua types (LuaE) in T.P.Filter.Lua. This restricts the parts of Pandoc that deal directly with hslua to T.P.Lua (and in tests, Tests.Lua). [API changes] T.P.Lua now exports `applyFilter`, `readCustom`, and `writeCustom`. The lower-level function `runFilterFile` is no longer exported.
2022-09-20Add T.P.Lua.Reader, T.P.Lua.Writer.John MacFarlane
(Unexported modules, presently.) These contain the definitions of `readCustom` and `writeCustom` that were previously in T.P.Readers.Custom and T.P.Writers.Custom. Motivation is to ensure that all of the Lua-related code is under the T.P.Lua tree. This will make it easier to make pandoc-lua a separate package or put lua support under a flag, if we decide to do that.
2022-09-20Text.Pandoc.App: export `IpynbOutput(..)`.John MacFarlane
[API change]
2022-09-20Ms writer: properly format display equations.John MacFarlane
Previously they were being translated to eqn as inline equations. Closes #8308.
2022-09-19Commonmark writer: ensure that we don't have blank lines in raw HTML.John MacFarlane
Closes #8307.
2022-09-19Org reader: Allow org-ref v2 citations with `&` prefix.John MacFarlane
Closes #8302.
2022-09-18BibTeX parser: fix handling of `%` in url field.John MacFarlane
`%` does not function as a comment character inside `url` (where URL-encoding is common). Commit 6fb2973a582116cd515c6f7e68794cca22955511 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-18Add prefixes to identifiers with `--file-scope`. (#8282)John MacFarlane
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-14Fix implicit_header_references with duplicate headings.John MacFarlane
Documentation says that when more than one heading has the same text, an implicit reference `[Heading text][]` refers to the first one. Previously pandoc linked to the last one instead. This patch makes pandoc conform to the documented behavior. See #8300.
2022-09-13XWiki writer: use template if it is specified.John MacFarlane
Previously templates were ignored completely. Closes #8296.
2022-09-12T.P.MIME: Removes more unnecessary overrides.Albert Krewinkel
| Ext. | Old type | New type | |-------|--------------------------|---------------------------------| | fm | application/x-maker | application/vnd.framemaker | | frame | application/x-maker | application/vnd.framemaker | | gsf | application/x-font | application/x-font-ghostscript | | java | text/x-java | text/x-java-source | | kpr | application/x-kpresenter | application/vnd.kde.kpresenter | | kpt | application/x-kpresenter | application/vnd.kde.kpresenter | | ksp | application/x-kspread | application/vnd.kde.kspread | | kwd | application/x-kword | application/vnd.kde.kword | | kwt | application/x-kword | application/vnd.kde.kword | | lha | application/x-lha | application/x-lzh-compressed | | lhz | application/x-lhz | application/x-lzh-compressed | | maker | application/x-maker | application/vnd.framemaker | | mif | application/x-mif | application/vnd.mif | | pl | text/x-perl | application/x-perl | | pm | text/x-perl | application/x-perl | | sisx | x-epoc/x-sisx-app | application/vnd.symbian.install | | sitx | application/x-stuffit | application/x-stuffitx | | skd | application/x-koan | application/vnd.koan | | skm | application/x-koan | application/vnd.koan | | skp | application/x-koan | application/vnd.koan | | skt | application/x-koan | application/vnd.koan | | tgz | application/x-gtar | application/x-tgz | | tk | text/x-tcl | application/x-tcl | | wpd | application/wordperfect | application/vnd.wordperfect |
2022-09-11T.P.MIME: Remove deprecated overrides (#8292)Albert Krewinkel
This changes the media type that's used for the file extension listed below. The new types are either IANA approved, or so similar to the override that is does not seem sensible to keep a separate entry.
2022-09-11Require mime-types 0.1.1Albert Krewinkel
This version has an updated list of media types, which renders some overrides redundant.
2022-09-09Citeproc: Require a digit for an implicit "page" locator...John MacFarlane
inside explicit locator syntax `{...}`. Previously a locator specified as `{}` would be rendered as `p.` with nothing after it. Closes #8288.
2022-09-05Docx writer: adjust correct attribute on lang element.John MacFarlane
For East Asian languages, we need to adjust `w:eastAsia` rather than `w:val`. This allows normal fonts to be used for any Latin-font text. Similarly, for bidi languages, we need to adjust `w:bidi` rather than `w:val`. We treat `he` and `ar` as bidi languages, `zh`, `ja`, `ko` as East Asian languages. Closes #7022.
2022-09-05HTML writer: only treat `. . .` as a slide pause in slides...John MacFarlane
...and not in regular HTML output. Closes #8281.
2022-09-04T.P.Mime: Base module on package mime-types. (#8277)Albert Krewinkel
The *mime-types* module is a dependency of *http-client* and therefore already a transitive dependency of pandoc.
2022-09-01JATS reader: handle uri element in references.John MacFarlane
Closes #8270.
2022-09-01Use dev version of gridtablesAlbert Krewinkel
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-08-31T.P.Citeproc.CslJson: allow an object with `items` property...John MacFarlane
...in addition to an array of references. This is what is returned by e.g. `https://api.zotero.org/groups/904125/items?v=3&q=صحافة&format=csljson` See comment in #7151.
2022-08-31Citeproc: check both extension and mime type to determine...John MacFarlane
...bibliography type when the bibliography is fetched remotely. This will help with cases where the URL ends in a parameter or otherwise does not end with a file extension. Closes #7151.
2022-08-31RTF writer: add space after unicode escape commands.John MacFarlane
Otherwise the `?` character that is there as a fallback for systems that can't process the unicode will be interpreted as the paramater's delimiter, and the NEXT character will be gobbled instead of `?`. Closes #8264 (fixes a problem with disappearing characters after unicode escapes).
2022-08-30Markdown: Allow table caption labels to start with lowercase t.John MacFarlane
Closes #8259.
2022-08-30Produce error if --csl is used more than once (#8252)Prat
Closes #8195. Co-authored-by: Prat T <[email protected]>
2022-08-30Docx reader: mark unnumbered headings with class 'unnumbered'Albert Krewinkel
If a document uses numbered headings, then headings without numbers are marked with class `unnumbered`, the default class used by pandoc to convey this kind of information. The classes are not added if none of the headings in a document are. This change ensures good conversion results when converting with `--number-sections`. Closes: #8148
2022-08-30MediaWiki writer: shorten codeAlbert Krewinkel
2022-08-30Mediawiki reader: Parse table cell with attribs, to support rowspan, colspan ↵Ruqi
(#8231)
2022-08-29PandocServer: return error in JSON object if response is JSON.John MacFarlane
2022-08-28PandocServer: set translations in the writer based on lang metadata.John MacFarlane
2022-08-28Text.Pandoc.Server: return object if JSON is accepted.John MacFarlane
Previously we just returned a JSON-encoded string. Now we return something like: ``` { "output": "<p>hello</p>" "base64": false, "messages": [ { "message": "Not rendering RawInline (Format \"tex\") \"\\\\noe\"", "verbosity": "INFO" } ], } ``` This is a change in the pandoc-server JSON API.
2022-08-27HTML, Markdown writers: filter out empty class attributes.John MacFarlane
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-27Avoid thunk in markdown reader.John MacFarlane
2022-08-27Fix a small space leak in HTML writer.John MacFarlane
2022-08-26HTML writer: avoid aria-hidden in code blocks for HTML4.John MacFarlane
Closes #8241. This requires depending on a new (still unreleased) version of skylighting-format-blaze-html.
2022-08-26Docx writer: Indent tables in list items.John MacFarlane
Closes #5947.
2022-08-26Docx writer: better handling of tables in lists (#5947).John MacFarlane
Previously the content of each list cell was indented when the table belonged to a list item. This is obviously unwanted. With this patch, a table inside a list item will be formatted just like a table outside the list. One desirable improvement would be to add some left indentation to the entire table, so it visually appears to belong to the list item. But I'm not sure how to do that.
2022-08-25HTML writer: use role combinator from blaze....John MacFarlane
instead of customAttribute.
2022-08-25HTML writer: only add role attribute in HTML5.John MacFarlane
It is not valid in HTML4. See #8241.
2022-08-25Markdown reader: fenced code block shortcuts with attributes (#8174)Siphalor
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-24LaTeX reader: handle `##` macro arguments properly.John MacFarlane
These turn into regular `#` arguments when expanded. Closes #8243.
2022-08-23LaTeX reader: skip parenthenized args of toprule, midrule, etc.John MacFarlane
Closes #8242.
2022-08-22HTML writer: revert to using `width` property for column widthsAlbert Krewinkel
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-22Org writer: add support for jupyter nodebook cells.Albert Krewinkel
Closes: #6367
2022-08-22Org writer: prefix code language of ipynb code blocks with `jupyter-`.Albert Krewinkel
This is the convention used by the *emacs-jupyter* package.
2022-08-22Org writer: keep code block attributes as header args.Albert Krewinkel
This allows to keep more information in the resulting `src` blocks, making it easier to roundtrip from or through Org. Org babel ignores unknown header arguments.
2022-08-22Org writer: add code block identifier as `#+name` to src blocks.Albert Krewinkel
2022-08-21pandoc-server: handle `citeproc` parameter as documented.John MacFarlane
Closes #8235.