aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
AgeCommit message (Collapse)AuthorFilesLines
2021-01-08Update copyright notices for 2021 (#7012)Albert Krewinkel35-36/+36
2021-01-04LaTeX reader: handle filecontents environment.John MacFarlane2-6/+28
Closes #7003.
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-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-30Hlint fixesJohn MacFarlane1-1/+1
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-10HTML reader: pay attention to lang attributes on body.John MacFarlane1-3/+6
These (as well as lang attributes on html) should update lang in metadata. See #6938.
2020-12-10HTML reader: retain attribute prefixes and avoid duplicates.John MacFarlane2-24/+24
Previously we stripped attribute prefixes, reading `xml:lang` as `lang` for example. This resulted in two duplicate `lang` attributes when `xml:lang` and `lang` were both used. This commit causes the prefixes to be retained, and also avoids invald duplicate attributes. Closes #6938.
2020-12-10Add sourcepos extension for commonmarkeJohn MacFarlane1-5/+9
* Add `Ext_sourcepos` constructor for `Extension`. * Add `sourcepos` extension (only for commonmark). * Bump to 2.11.3 With the `sourcepos` extension set set, `data-pos` attributes are added to the AST by the commonmark reader. No other readers are affected. The `data-pos` attributes are put on elements that accept attributes; for other elements, an enlosing Div or Span is added to hold the attributes. Closes #4565.
2020-12-10Commonmark reader: refactor specFor, set input name to "".John MacFarlane1-2/+8
2020-12-07Dokuwiki reader: handle unknown interwiki links better.John MacFarlane1-1/+1
DokuWiki lets the user define his own Interwiki links. Previously pandoc reacted to these by emitting a google search link, which is not helpful. Instead, we now just emit the full URL including the wikilink prefix, e.g. `faquk>FAQ-mathml`. This at least gives users the ability to modify the links using filters. Closes #6932.
2020-12-05Org reader: preserve targets of spurious linksAlbert Krewinkel1-5/+4
Links with (internal) targets that the reader doesn't know about are converted into emphasized text. Information on the link target is now preserved by wrapping the text in a Span of class `spurious-link`, with an attribute `target` set to the link's original target. This allows to recover and fix broken or unknown links with filters. See: #6916
2020-12-05LaTeX reader: don't apply theorem default styling to a figure inside.John MacFarlane1-0/+1
If we put an image in italics, then when rendering to Markdown we no longer get an implicit figure. Closes #6925.
2020-11-29LaTeX reader: don't parse `\rule` with width 0 as horizontal rule.John MacFarlane1-1/+11
2020-11-28Fix a tiny Typo in the CSV reader moduleTassos Manganaris1-1/+1
Header comment in the CSV reader module says "RST" instead of "CSV".
2020-11-27HTML reader tests: improve test coverage of new featuresAlbert Krewinkel1-1/+2
2020-11-27HTML reader: support body headers, row head columnsAlbert Krewinkel1-41/+61
Closes: #6312
2020-11-26LaTeX reader: preserve center environment (#6852)Igor Pashev1-1/+1
The contents of the `center` environment are put in a `Div` with class `center`.
2020-11-26HTML reader: improve support for table headers, footer, attributesAlbert Krewinkel3-102/+223
- `<tfoot>` elements are no longer added to the table body but used as table footer. - Separate `<tbody>` elements are no longer combined into one. - Attributes on `<thead>`, `<tbody>`, `<th>`/`<td>`, and `<tfoot>` elements are preserved.
2020-11-26HTML reader: allow finer grained options for tag omissionAlbert Krewinkel3-13/+26
2020-11-25HTML reader: simplify list attribute handlingAlbert Krewinkel1-18/+9
This removes the `foldOrElse` function from the internal Text.Pandoc.CSS module.
2020-11-24HTML reader: support row or column-spanning table cellsAlbert Krewinkel2-28/+26
2020-11-24HTML reader: support blocks in captionAlbert Krewinkel2-6/+6
2020-11-24HTML reader: extract table parsing into separate moduleAlbert Krewinkel3-95/+140
2020-11-23HTML reader: extract submodulesAlbert Krewinkel4-239/+342
Reducing module size should reduce memory use during compilation. This is preparatory work to tackle support for more table features.
2020-11-22Org reader: parse `#+LANGUAGE` into `lang` metadata fieldAlbert Krewinkel1-0/+2
Fixes: #6845
2020-11-21LaTeX reader: more robust parsing of bracketed options.John MacFarlane1-3/+8
Improves on 9a40976. Closes #6873.
2020-11-20DocBook reader: Table text width support (#6791)Nils Carlson1-2/+12
Table width in relation to text width is not natively supported by docbook but is by the docbook fo stylesheets through an XML processing instruction, <?dbfo table-width="50%"?> . Implement support for this instruction in the DocBook reader.
2020-11-20Improve LaTeX option parsing...John MacFarlane1-1/+3
in cases where we run into trouble parsing inlines til the closing `]`, e.g. quotes, we return a plain string with the option contents. Previously we mistakenly included the brackets in this string. Closes #6869.
2020-11-19DocBook reader: drop period in formalpara title...John MacFarlane1-2/+2
...and put it in a div with class `formalpara-title`, so that people can reformat with filters. Closes #6562. Thanks to rdmuller.
2020-11-18Man reader: improve handling of .IP.John MacFarlane1-5/+19
We now better handle `.IP` when it is used with non-bullet, non-numbered lists, creating a definition list. We also skip blank lines like groff itself. Closes #6858.
2020-11-18Replace org #+KEYWORDS with #+keywordsTEC1-11/+11
As of ~2 years ago, lower case keywords became the standard (though they are handled case insensitive, as always): https://code.orgmode.org/bzg/org-mode/commit/13424336a6f30c50952d291e7a82906c1210daf0 Upper case keywords are exclusive to the manual: - https://orgmode.org/list/871s50zn6p.fsf@nicolasgoaziou.fr/ - https://orgmode.org/list/87tuuw3n15.fsf@nicolasgoaziou.fr/
2020-11-17Bibtex reader: fall back on en-US if locale for LANG not found.John MacFarlane1-1/+4
This reproduces earlier pandoc-citeproc behavior. Closes jgm/citeproc#26.
2020-11-17Markdown reader: fix regression with example list references.John MacFarlane1-1/+5
This affects example list references followed by dashes. Introduced by commit b8d17f7. Closes #6855.
2020-11-16Move getNextNumber from Readers.LaTeX to Readers.LaTeX.Parsing.John MacFarlane2-26/+26
2020-11-16Improve fix to siunitx numbers with minus.John MacFarlane1-1/+1
- use real minus sign - use tests contributed by Igor Pashev.
2020-11-16LaTeX reader: Fix negative numbers in siunitx commands.John MacFarlane1-2/+4
The commit a157e1a broke negative numbers, e.g. `\SI{-33}{\celcius}` or `\num{-3}`. This fixes the regression.
2020-11-15Markdown reader: fix detection of locators following in-text citations.John MacFarlane1-27/+30
Prevously, if we had `@foo [p. 33; @bar]`, the `p. 33` would be incorrectly parsed as a prefix of `@bar` rather than a suffix of `@foo`.
2020-11-14Markdown reader: don't increment stateNoteNumber for example refs.John MacFarlane1-0/+12
Background: syntactically, references to example list items can't be distinguished from citations; we only know which they are after we've parsed the whole document (and this is resolved in the `runF` stage). This means that pandoc's calculation of `citationNoteNum` can sometimes be wrong when there are example list references. This commit partially addresses #6836, but only for the case where the example list references refer to list items defined previously in the document.
2020-11-10Remove redundant bracket.John MacFarlane1-1/+1
2020-11-10Fix corner case in YAML metadata parsing.John MacFarlane1-1/+4
Previously YAML metadata would sometimes not get recognized if a field ended with a newline followed by spaces. Closes #6823.
2020-11-07Lint code in PRs and when committing to master (#6790)Albert Krewinkel10-20/+15
* Remove unused LANGUAGE pragmata * Apply HLint suggestions * Configure HLint to ignore some warnings * Lint code when committing to master
2020-11-05LaTeX reader: better handling of `\\` inside math in table cells.John MacFarlane1-0/+2
Previously this confused the table parser. Closes #6811.
2020-11-03Properly support optional cite argument for `\blockquote`.John MacFarlane1-7/+8
(LaTeX reader) Closes #6802.
2020-11-02LaTeX reader: fix bug parsing macro arguments.John MacFarlane1-1/+5
If `\cL` is defined as `\mathcal{L}`, and `\til` as `\tilde{#1}`, then `\til\cL` should expand to `\tilde{\mathcal{L}}`, but pandoc was expanding it to `\tilde\mathcal{L}`. This is fixed by parsing the arguments in "verbatim mode" when the macro expands arguments at the point of use. Closes #6796.
2020-10-26DocBook Reader: fix duplicate bibliography bug (#6773)Nils Carlson1-5/+4
Also add unit test to ensure the behavior stays consistent.
2020-10-23HTML reader: Parse contents of iframes.John MacFarlane1-4/+17
See #6770.
2020-10-23HTML reader: parse inline svg as image...John MacFarlane1-0/+17
...unless `raw_html` is set in the reader (in which case the svg is passed through as raw HTML). Closes #6770.