aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2021-01-26Lua: always load built-in Lua scripts from default data-dirAlbert Krewinkel4-46/+44
The Lua modules `pandoc` and `pandoc.List` are now always loaded from the system's default data directory. Loading from a different directory by overriding the default path, e.g. via `--data-dir`, is no longer supported to avoid unexpected behavior and to address security concerns.
2021-01-22ImageSize: use viewBox for svg if no length, width.John MacFarlane1-2/+6
This change allows pandoc to extract size information from more SVGs. Closes #7045.
2021-01-22Merge pull request #7042 from tarleb/jats-element-citationsJohn MacFarlane5-25/+213
JATS writer: use element citations
2021-01-22JATS writer: allow to use element-citationAlbert Krewinkel4-7/+192
2021-01-22Add biblatex, bibtex as output formats (closes #7040).John MacFarlane4-3/+306
* `biblatex` and `bibtex` are now supported as output as well as input formats. * New module Text.Pandoc.Writers.BibTeX, exporting writeBibTeX and writeBibLaTeX. [API change] * New unexported function `writeBibtexString` in Text.Pandoc.Citeproc.BibTeX.
2021-01-21Text.Pandoc.Citeproc: use finer grained importsAlbert Krewinkel1-18/+21
This allows to import the module in writers without causing a circular dependency.
2021-01-19JATS writer: Ensure that disp-quote is always wrapped in p.John MacFarlane1-1/+3
Closes #7041.
2021-01-18RST writer: fix #7039.John MacFarlane1-2/+2
We were losing content from inside spans with a class, due to logic that is meant to avoid nested inline structures that can't be represented in RST. The logic was a bit stricter than necessary. This commit fixes the issue.
2021-01-16Revert "Markdown reader: support GitHub wiki's internal links (#2923) (#6458)"John MacFarlane2-28/+0
This reverts commit 6efd3460a776620fdb93812daa4f6831e6c332ce. Since this extension is designed to be used with GitHub markdown (gfm), we need to implement the parser as a commonmark extension (commonmark-extensions), rather than in pandoc's markdown reader. When that is done, we can add it here.
2021-01-16Markdown reader: support GitHub wiki's internal links (#2923) (#6458)Gautier DI FOLCO2-0/+28
Canges overview: * Add a `Ext_markdown_github_wikilink` constructor to `Extension` [API change]. * Add the parser `githubWikiLink` in `Text.Pandoc.Readers.Markdown` * Add tests.
2021-01-16Recognize more extensions as markdown by default.John MacFarlane1-0/+5
`mkdn`, `mkd`, `mdwn`, `mdown`, `Rmd`. Closes #7034.
2021-01-12Markdown writer: cleaned up raw formats.John MacFarlane1-34/+35
We now react appropriately to gfm, commonmark, and commonmark_x as raw formats.
2021-01-12Docx writer: handle table header using styles.John MacFarlane1-17/+20
Instead of hard-coding the border and header cell vertical alignment, we now let this be determined by the Table style, making use of Word's "conditional formatting" for the table's first row. For headerless tables, we use the tblLook element to tell Word not to apply conditional first-row formatting. Closes #7008.
2021-01-10JATS writer: fix citations (#7018)Albert Krewinkel2-26/+23
* JATS writer: keep code lines at 80 chars or below * JATS writer: fix citations
2021-01-10Fix infinite HTTP requests when writing epubs from URL source.John MacFarlane1-5/+9
Due to a bug in code added to avoid overwriting the cover image if it had the form `fileX.YYY`, pandoc made an endless sequence of HTTP requests when writing epub with input from a URL. Closes #7013.
2021-01-10T.P.Citeproc: factor out and export `getStyle`.John MacFarlane1-45/+55
2021-01-10T.P.Citeproc: factor out getLang.John MacFarlane1-8/+15
2021-01-10T.P.Citeproc: refactor and export `getReferences`.John MacFarlane1-28/+51
See #7016.
2021-01-09Org reader: allow multiple pipe chars in todo sequencesAlbert Krewinkel1-4/+10
Additional pipe chars, used to separate "action" state from "no further action" states, are ignored. E.g., for the following sequence, both `DONE` and `FINISHED` are states with no further action required. #+TODO: UNFINISHED | DONE | FINISHED Previously, parsing of the todo sequence failed if multiple pipe chars were included. Closes: #7014
2021-01-08Update copyright notices for 2021 (#7012)Albert Krewinkel136-149/+149
2021-01-07gfm/commonmark writer: implement start number on ordered lists.John MacFarlane1-1/+4
Previously they always started at 1, but according to the spec the start number is respected. Closes #7009.
2021-01-07T.P.Parsing: modify gridTableWith' for headerless tables.John MacFarlane1-11/+11
If the table lacks a header, the header row should be an empty list. Previously we got a list of empty cells, which caused an empty header to be emitted instead of no header. In LaTeX/PDF output that meant we got a double top line with space between. @tarleb @despres - please let me know if this is problematic for some reason I'm not grasping.
2021-01-05HTML writer: fix implicit_figure at end of footnotes.John MacFarlane1-3/+7
Closes #7006.
2021-01-05Implement defaults file inheritance (#6924)David Martschenko2-33/+139
Allow defaults files to inherit options from other defaults files by specifying them with the following syntax: `defaults: [list of defaults files or single defaults file]`.
2021-01-04LaTeX reader: handle filecontents environment.John MacFarlane2-6/+28
Closes #7003.
2021-01-04EPUB writer: adjust internal links to identifiers...John MacFarlane1-0/+20
defined in raw HTML sections after splitting into chapters. Closes #7000.
2021-01-03EPUB writer: recognize `Format "html4"`, `Format "html5"` as raw HTML.John MacFarlane1-2/+8
2021-01-03EPUB writer: adjust internal links to images, links, and tables...John MacFarlane1-0/+6
after splitting into chapters. Previously we only did this for Div and Span and Header elements. See #7000.
2021-01-03Org reader: mark verbatim code with class "verbatim". (#6998)Dimitri Sabadie1-1/+1
* Replace org-mode’s verbatim from code to codeWith. This adds the `"verbatim"` class so that exporters can apply a specific style on it. For instance, it will be possible for HTML to add a CSS rule for code + verbatim class. * Alter test for org-mode’s verbatim change. See previous commit for further detail on the new implementation.
2021-01-02LaTeX reader: put contents of unknown environments in a Div...John MacFarlane1-1/+1
when `raw_tex` is not enabled. (When `raw_tex` is enabled, the whole environment is parsed as a raw block.) The class name is the name of the environment. Previously, we just included the contents without the surrounding Div, but having a record of the environment's boundaries and name can be useful. Closes #6997.
2021-01-02LaTeX writer: revert table line height increase in 2.11.3.John MacFarlane1-1/+1
In 2.11.3 we started adding `\addlinespace`, which produced less dense tables. This wasn't an intentional change; I misunderstood a comment in the discussion leading up to the change. This commit restores the earlier default table appearance. Note that if you want a less dense table, you can use something like `\def\arraystretch{1.5}` in your header. Closes #6996.
2021-01-01Org reader: restructure output of captioned code blocksAlbert Krewinkel1-14/+12
The Div wrapper of code blocks with captions now has the class "captioned-content". The caption itself is added as a Plain block inside a Div of class "caption". This makes it easier to write filters which match on captioned code blocks. Existing filters will need to be updated. Closes: #6977
2020-12-30Mediawiki reader: allow space around storng/emph delimiters.John MacFarlane1-6/+4
Closes #6993.
2020-12-30Undo the "Use fromRight" hlint hint.John MacFarlane1-2/+1
2020-12-30Hlint fixesJohn MacFarlane2-2/+3
2020-12-30Ms writer: don't justify inside table cells.John MacFarlane1-1/+3
2020-12-29Improve fix to #6983.John MacFarlane1-1/+3
If we have a paragraph then a bookmarkEnd, we don't need to insert the empty paragraph (and in fact it alters the spacing). Closes #6983.
2020-12-28Docx writer: fix nested tables with captions.John MacFarlane1-4/+6
Previously we got unreadable content, because docx seems to want a `<w:p>` element (even an empty one) at the end of every table cell. Closes #6983.
2020-12-28HTML reader: use renderTags' from Text.Pandoc.Shared.Albert Krewinkel1-25/+3
The `renderTags'` function was duplicated when the reader used `Text` as its string type. The duplication is no longer necessary. A side effect of this change is that empty `<col>` elements are written as self-closing tags in raw HTML blocks.
2020-12-27Use meta-description instead of description in templates.John MacFarlane1-0/+3
Since this is an attribute value, we need to prepare it in the writer.
2020-12-27Add support for writing nested tables to asciidoc (#6972)timo-a1-7/+32
Added field to WriterState that denotes the current nesting level for traversing tables. Depending on the value of that field nested tables are recognized and written. Asciidoc supports one level of nesting. If deeper tables are to be written, they are omitted and a warning is issued.
2020-12-27Powerpoint writer: allow arbitrary OOXML in raw inline elementsAlbert Krewinkel1-22/+27
The raw text is now included verbatim in the output. Previously is was parsed into XML elements, which prevented the inclusion of partial XML snippets.
2020-12-24Citeproc: fix handling of empty URL variables (`DOI`, etc.).John MacFarlane1-1/+3
The `linkifyVariables` function was changing these to links which then got treated as non-empty by citeproc, leading to wrong results (e.g. ignoring nonempty URL when empty DOI is present). Addresses part 2 of jgm/citeproc#41.
2020-12-20HTML writer: don't include p tags in CSL bibliography entries.John MacFarlane1-2/+7
Fixes a regression in 2.11.3. Closes #6966
2020-12-20LaTeX writer: support colspans and rowspans in tables. (#6950)Albert Krewinkel4-96/+236
Note that the multirow package is needed for rowspans. It is included in the latex template under a variable, so that it won't be used unless needed for a table.
2020-12-16Fix citeproc regression with duplicate references.John MacFarlane1-1/+2
- Use dev version of citeproc, which handles duplicate ids better, preferring the last one in the list and discarding the rest. - Ensure that inline citations take priority over external ones. See jgm/citeproc#36. This restores the behavior of pandoc-citeproc.
2020-12-16Support Lua marshalling of doctemplates BoolVal.John MacFarlane1-0/+1
This updates T.P.Lua.Marshaling.Context for doctemplates >= 0.9.
2020-12-15Properly handle boolean values in writing YAML metadata.John MacFarlane2-2/+3
(Markdown writer.) This requires doctemplates >= 0.9. Closes #6388.
2020-12-15Use fetchItem to get external bibliography.John MacFarlane1-8/+7
This means that: - a URL may be provided, and pandoc will fetch the resource. - Pandoc will search the resource path for the bibliography if it is not found relative to the working directory. Closes #6940.
2020-12-15Allow both inline and external references to be usedJohn MacFarlane1-14/+15
with `--citeproc`. This fixes a regression, since pandoc-citeproc allowed these to be combined. Closes #6951.