aboutsummaryrefslogtreecommitdiff
path: root/src/Text
AgeCommit message (Collapse)Author
2022-01-13When reading defaults file, stop at a line `...`.John MacFarlane
This line signals the end of a YAML document. This restores the behavior we got with HsYaml. yaml complains about content past this line. See https://github.com/jgm/pandoc/issues/4627#issuecomment-1012438765
2022-01-12Citeproc: allow `notes-after-punctuation` to work...John MacFarlane
with numerical styles that use superscripts (e.g. american-medical-association.csl), as well as with note styles. The default setting of `notes-after-punctuation` is true for note styles and false otherwise. This restores a behavior of pandoc-citeproc that wasn't properly carried over to Citeproc. Closes #7826. See also jgm/pandoc-citeproc#384.
2022-01-11Docx writer: Handle bullets correctly in lists by not reusing numIds (#7822)Michael Hoffmann
Make sure that we only create one bullet per list item in docx. In particular, when a div is a list item, its contained paragraphs will now no longer wrongly get individual bullets. This is accomplished by making sure that for each list, we only use the associated numId once. Any repeated use would add incorrect bullets to the document. Closes #7689
2022-01-10DocBook reader: Collapse internal spaces in literal...John MacFarlane
and other similar tags. This seems to accord with what the docbook toolchain does. Closes #7821.
2022-01-10HTML writer: don't break attributes values when wrapping.John MacFarlane
2022-01-10Fix regression: allow blank lines in HTML attributes.John MacFarlane
The commit 7a9832166e36f77402d5e0259647e9f5c7ba4e58 had the effect that blank lines would be collapsed in HTML attributes. We also roll back a change that collapsed multiple spaces into one.
2022-01-09Improve abstract in HTML template.John MacFarlane
* Add localized title "abstract", unless `abstract-title` variable is set. * Add `abstract-title` div to abstract CSS. * Move abstract CSS out of CSL conditional. * Ensure that abstract is aligned left but indented on all sides. * Use smaller font for abstract. Improves #7588.
2022-01-09Org reader: support alphabetical (fancy) listsLucas Viana
This adds support for alphabetical lists in org by enabling the extension Ext_fancy_lists, mimicking the behaviour of Org Mode when org-list-allow-alphabetical is enabled. Enabling Ext_fancy_lists will also make Pandoc differentiate between the delimiters of ordered lists (periods or closing parentheses). Org does this differentiation by default when exporting to some formats (e.g. plain text) but does not in others (e.g. html and latex), so I decided to copy Pandoc's markdown reader behaviour.
2022-01-08Org writer: fix list items starting with a code block...John MacFarlane
or other non-paragraph content. Closes #7810.
2022-01-08Avoid blank lines after tight sublists in org, haddock.John MacFarlane
T.P.Writers.Shared `endsWithPlain` now returns True if the list ends with a list which ends with a Plain. See #7810.
2022-01-08RST writer: avoid extra blank line after empty list item.John MacFarlane
See #7810 (2).
2022-01-08Org writer: fix extra blank line inserted after empty list item.John MacFarlane
Addresses issue 2 from #7810.
2022-01-08Org writer: don't add blank line before lists.John MacFarlane
The code to do this was apparently copied over from the RST writer, but these blank lines aren't necessary or desirable in org. See #7810 comment 3.
2022-01-08writeMedia: unescape percent-encoding in creating file path.John MacFarlane
Closes #7819 (problem with spaces in image filenames when creating PDFs).
2022-01-08toLocatorMap: store keys as lowercase.John MacFarlane
We want to do a case-insensitive comparison when parsing locators, so that e.g. both `Chap.` and `chap.` work. Previously we lowercase terms when doing the lookup, but they weren't lowercased in the map itself, which led to locator-detection breaking for German (where the terms have uppercase letters). See https://groups.google.com/d/msgid/pandoc-discuss/1dd44886-7b79-4e5f-97ec-57b91113df36n%40googlegroups.com
2022-01-07T.P.Readers.LaTeX.SIunitx: explicit imports.John MacFarlane
2022-01-07Fix parsing of footnotes in `--metadata-file`.John MacFarlane
Closes #7813.
2022-01-07Org writer: support starting number cookiesLucas Viana
This complements #7806 by supporting writing Org ordered lists that start at a specific number.
2022-01-07Add LaTeX babel mappings for Guajati (gu) and Oriya (or).John MacFarlane
Closes #7815.
2022-01-07Fix typo panjabi -> punjabi.John MacFarlane
This affects the mapping to Babel language names in the LaTeX reader and writer. Closes #7814.
2022-01-06MediaWiki writer: Remove redundant display text for wiki linksJesse Hathaway
Prior to this commit the MediaWiki writer always added the display text for a wiki link: * [[Help|Help]] * [[Bubbles|Everyone loves bubbles]] However the display text in the first example is redundant since MediaWiki uses the target as the default display text. The result being: * [[Help]] * [[Bubbles|Everyone loves bubbles]]
2022-01-06reveal.js: Make sure images with r-stretch are not in p tags.John MacFarlane
They must be direct children of the section. There was previously code to make this work with the older class name `stretch`. See https://github.com/jgm/pandoc/issues/5965#issuecomment-1006623836
2022-01-06reveal.js: don't add r-fit-text class to section.John MacFarlane
It must go on header only. See https://github.com/jgm/pandoc/issues/5965#issuecomment-1006623836
2022-01-06Org reader: support counter cookies in listsLucas Viana
This adds support for counter cookies in org lists. Such cookies are used to override the item counter in ordered lists. In org it is possible to set the counter at any list item, but since Pandoc AST does not support this, we restrict the usage to setting an offset for the entire ordered list, by using the cookie in the first list item. Note that even though unordered lists do not have counters, Org Mode still parses such cookies in unordered lists and suppresses them in the output, so we do the same. Also, even though org-list-allow-alphabetical is disabled in Emacs by default, for some reason alphabetical cookies are always parsed and used in Org Mode regardlessly of whether this option is enabled or the list style is decimal, so we do the same. E.g. 2. test 3. test Is parsed as an ordered list starting at 1, as before. This also conforms to Org Mode behaviour. 1. [@2] test 2. test Is now parsed as an ordered list starting at 2, so that it conforms to Org Mode behaviour. Note that when parsing 1. [@2] test 2. [@9] test the second cookie is silenced and the entire list starts at 2. This is because the current Pandoc AST does not support expressing a change in the counter at a specific item.
2022-01-05AsciiDoc writer: improve detection of intraword emphasis.John MacFarlane
Closes #7803.
2022-01-04Lua: add `pandoc.template` moduleAlbert Krewinkel
The module provides a `compile` function to use strings as templates.
2022-01-04Lua: marshal templates as opaque userdata valuesAlbert Krewinkel
2022-01-04Lua: add `pandoc.WriterOptions` constructorAlbert Krewinkel
2022-01-04Lua: add function `pandoc.write`Albert Krewinkel
2022-01-04Stop exporting `writeCustom` from module T.P.Writers [API change]Albert Krewinkel
This ensures that all writer exported in T.P.Writers are parameterized and work with any `PandocMonad` type. This is consistent with T.P.Readers, as `readCustom` is not exported from that module either.
2022-01-03Markdown writer: fix indentation issue in footnotes.John MacFarlane
Closes #7801.
2022-01-03DocBook reader: be sensitive to spacing="compact" in lists.John MacFarlane
When spacing="compact" is set, Para elements are turned into Plain, so we get a "tight" list. Closes #7799.
2022-01-03Issue error with --list-extensions for invalid formats.John MacFarlane
Cloess #7797.
2022-01-03parseFormatSpec: cleaner error message for invalid extensions.John MacFarlane
2022-01-03Minor code improvement.John MacFarlane
2022-01-03Don't read sources until in/out format are verified.John MacFarlane
Partially addresses #7797.
2022-01-02Odt: Add list-headerTuong Nguyen Manh
The list-header is a type of list-item. Therefore, it will be treated exactly like one.
2022-01-02Copyright notices: update for 2022Albert Krewinkel
2022-01-02Lua writer: allow variables to be set via second return value of `Doc`Albert Krewinkel
New templates variables can be added by giving variable-value pairs as a second return value of the global function `Doc`. Example: function Doc (body, meta, vars) vars.date = vars.date or os.date '%B %e, %Y' return body, vars end Closes: #6731
2022-01-02Lua writer: provide global `PANDOC_WRITER_OPTIONS`Albert Krewinkel
Closes: #6731
2022-01-01Use latest version of KaTeX.John MacFarlane
2022-01-01Lua: provide global `PANDOC_WRITER_OPTIONS` [API change]Albert Krewinkel
API changes: - The function T.P.Filter.applyFilters now takes a filter environment of type `Environment`, instead of a ReaderOptions value. The `Environment` type is exported from `T.P.Filter` and allows to combine ReaderOptions and WriterOptions in a single value. - Global, exported from T.P.Lua, has a new type constructor `PANDOC_WRITER_OPTIONS`. Closes: #5221
2022-01-01Apply some HLint suggestionsAlbert Krewinkel
2022-01-01Org reader: allow trailing spaces after key/value pairs in directivesAlbert Krewinkel
Ensures that spaces at the end of attribute directives like `#+ATTR_HTML: :width 100%` (note the trailing spaces) are accepted.
2022-01-01Lua: marshal ReaderOptions field `extensions`, `track_changes` via JSONAlbert Krewinkel
Extensions are now available as a list of strings; the track-changes settings are given as the kebab-case representation used in JSON.
2021-12-31Lua: use global state when parsing documents in `pandoc.read`Albert Krewinkel
The function `pandoc.read` is updated to use the same state that was used while parsing the main input files. This ensures that log messages are preserved and that images embedded in the input are added to the mediabag.
2021-12-31Lua: cleanup stack in peekReadOptionsTableAlbert Krewinkel
A ReaderOptions element was left on top of the stack when the `peekReadOptionsTable` function was invoked.
2021-12-30Docx reader: handle multiple pic elements inside a drawing.John MacFarlane
Closes #7786.
2021-12-30Docx reader: change elemToParPart to return [ParPart]John MacFarlane
...instead of ParPart. Also remove NullParPart constructor, as it is no longer needed. This will allow us to handle elements that contain multiple ParParts, e.g. w:drawing elements with multiple pic:pic. See #7786.
2021-12-30Fix ghc 9.2.1 warnings.John MacFarlane