aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
AgeCommit message (Collapse)AuthorFilesLines
2017-03-20Add `space_in_atx_header` extension.John MacFarlane1-0/+1
This is enabled by default in pandoc and GitHub markdown but not the other flavors. This requirse a space between the opening #'s and the header text in ATX headers (as CommonMark does but many other implementations do not). This is desirable to avoid falsely capturing things ilke #hashtag or #5 Closes #3512.
2017-03-19RST reader: recurse into bodies of unknown directives.John MacFarlane1-1/+2
In most cases it's better to preserve the content than to emit it. This isn't guaranteed to have good results; it will fail spectacularly for unknown raw or verbatim directives. See #3432.
2017-03-18HTML reader: Better sanity checks on raw HTML.John MacFarlane1-6/+17
This also affects the Markdown reader. Closes #3257.
2017-03-13Better handling of \part in LaTeX.John MacFarlane1-8/+17
Closes #1905. Removed stateChapters from ParserState. Now we parse chapters as level 0 headers, and parts as level -1 headers. After parsing, we check for the lowest header level, and if it's less than 1 we bump everything up so that 1 is the lowest header level. So `\part` will always produce a header; no command-line options are needed.
2017-03-12Org reader: interpret more meta value as inlinesAlbert Krewinkel1-4/+9
The values of the following meta variables are now interpreted using org-markup instead of treating them as pure strings: - *keywords*: comma-separated list of inlines - *subtitle*: inline values - *nocite*: inline values; using it multiple times accumulates the values.
2017-03-12Issue warning for duplicate header identifiers.John MacFarlane4-5/+28
As noted in the previous commit, an autogenerated identifier may still coincide with an explicit identifier that is given for a header later in the document, or with an identifier on a div, span, link, or image. This commit adds a warning in this case, so users can supply an explicit identifier. * Added `DuplicateIdentifier` to LogMessage. * Modified HTML, Org, MediaWiki readers so their custom state type is an instance of HasLogMessages. This is necessary for `registerHeader` to issue warnings. See #1745.
2017-03-11Markdown reader: optimized nonindentSpaces.John MacFarlane1-6/+3
Makes the benchmark go from 40 to 36 ms.
2017-03-10Removed normalizeSpaces from Text.Pandoc.Shared.John MacFarlane1-0/+6
Rewrote functions in RST reader and writer to avoid the need for it. Closes #1530.
2017-03-10Docx reader: more efficient trimSps.John MacFarlane1-9/+9
Replacing trimLineBreaks. This does the work of normalizeSpaces as well, so we avoid the need for that function here. See #1530.
2017-03-10Expand \newenvironment macros.John MacFarlane1-10/+12
Closes #987. Depends on still unreleased texmath 0.9.3.
2017-03-09LaTeX reader: Treat `{{xxx}}` the same as `{xxx}`.John MacFarlane1-9/+14
Closes #2115.
2017-03-08Org reader: disallow tables on list marker linesAlbert Krewinkel1-3/+4
Fixes: #3499
2017-03-08Org reader: don't allow tables inside list items.John MacFarlane1-0/+4
Closes #3499.
2017-03-07Markdown reader: Treat certain environments as inlineJohn MacFarlane1-1/+3
when they occur without space surrounding them. E.g. equation, math. This avoids incorrect vertical space around equations. Closes #3309. Closes #2171. See also rstudio/bookdown#358.
2017-03-06LaTeX reader: allow newpage, clearpage, pagebreak in inline contextsJohn MacFarlane1-0/+5
as well as block contexts. Closes #3494.
2017-03-05LaTeX reader: support all \textXX commands.John MacFarlane1-1/+5
where XX = rm, tt, up, md, sf, bf. Spans with a class are used when there is nothing better. Closes #3488.
2017-03-05Markdown reader: fixed internal header links.John MacFarlane1-2/+7
Closes #2397. This patch also adds `shortcut_reference_links` to the list of mmd extensions.
2017-03-05LaTeX reader: small improvements in parsing arguments.John MacFarlane1-10/+7
2017-03-05LaTeX reader: Handle spaces before \cite arguments.John MacFarlane1-3/+1
2017-03-05Added readerAbbreviations to ParserState.John MacFarlane1-25/+16
Markdown reader now consults this to determine what is an abbreviation. Eventually it will be possible to specify a custom list (see #256).
2017-03-05Markdown reader: Fixed regression on left-biased union for metadata.John MacFarlane1-6/+9
When multiple YAML metadata blocks are used, and two define the same field, the value defined first takes precedence, according to the manual. This was changed briefly in ba3ee62323644134f2a5dd3277e3349d3681111a. This commit reverts to the original behavior and adds a test case.
2017-03-05Parse YAML metadata in a context that sees footnotes...John MacFarlane1-84/+83
defined in the body of the document. Closes #1279.
2017-03-04Fixed some loose ends in #1592.John MacFarlane1-1/+3
Added test cases. Fixed HTML reader to parse a span with class "smallcaps" as SmallCaps. Fixed Markdown writer to render SmallCaps as a native span when native spans are enabled.
2017-03-04Markdown reader: treat span with class `smallcaps` as SmallCaps.John MacFarlane1-13/+18
This allows users to specify small caps in Markdown this way: [my text]{.smallcaps} See #1592.
2017-03-04Stylish-haskell automatic formatting changes.John MacFarlane27-464/+467
2017-03-03RST reader: support RST-style citations.John MacFarlane1-14/+54
The citations appear at the end of the document as a definition list in a special div with id `citations`. Citations link to the definitions. Added stateCitations to ParserState. Closes #853.
2017-03-02RST reader: Handle multiline cells in simple tables.John MacFarlane1-8/+16
Closes #1166.
2017-03-02Markdown reader: when splitting pipe table cells, skip tex math.John MacFarlane1-1/+1
You might have a `|` character inside math. (Or for that matter something that the parser might mistake for raw HTML.) See #3481.
2017-03-01LaTeX reader: don't drop contents of \hypertarget.John MacFarlane1-0/+3
2017-02-28RST reader: implemented implicit internal header links.John MacFarlane1-18/+42
Cloess #3475.
2017-02-27LaTeX reader: Handle komascript `\dedication`.John MacFarlane1-0/+2
It now adds a `dedication` field to metadata. It is up to the user to supply a template that uses this variable. Closes #1845.
2017-02-27Minor cleanups in LaTeX reader.John MacFarlane1-5/+4
2017-02-26RST reader: support scale and align attributes of images.John MacFarlane1-5/+25
Closes #2662.
2017-02-25LaTeX reader: allow hspace and vspace to count as raw block or inline.John MacFarlane1-3/+5
Previously we would refuse to parse anything as raw inline if it was in the blockCommands list. Now we allow exceptions if they're listed under ignoreInlines in inlineCommands. This should make it easier e.g. to include an \hspace between two side-by-side raw LaTeX tables.
2017-02-25Revert "LaTeX reader: don't treat `\vspace` and `\hspace` as block commands."John MacFarlane1-0/+1
This reverts commit 2873cd82886d1fa557bf3abde37b5ceb3cadf40c.
2017-02-24Implemented `\graphicspath` in LaTeX reader.John MacFarlane1-1/+8
Closes #736.
2017-02-24EPUB reader: minor refactoring, avoiding explicit MediaBag handling.John MacFarlane1-8/+6
This all works behind the scenes in CommonState plumbing.
2017-02-22When parsing raw LaTeX commands, include trailing space.John MacFarlane1-2/+2
Otherwise things like `\noindent foo` break and turn into `\noindentfoo`. Affects `-f latex+raw_tex` and `-f markdown` (and other formats that allow `raw_tex`). Closes #1773.
2017-02-21MediaWiki reader: ensure that list starts begin at left margin.John MacFarlane1-9/+18
Including when they're in tables or other list items. Closes #2606.
2017-02-21MediaWiki reader: fixed more table issues.John MacFarlane1-9/+7
Closes #2649.
2017-02-21MediaWiki reader: Allow blank line after table start.John MacFarlane1-1/+1
See #2649.
2017-02-21MediaWiki tables: allow extra hyphens after `|-` in tables.John MacFarlane1-1/+1
I didn't see this documented anywhere, but it seems to be allowed (and common). See #2649. This addresses some of the cases there, but not all.
2017-02-20Tighten up HasQuoteContext instance in HTML reader.John MacFarlane1-1/+1
We constrain it to the state used in the HTML reader. Otherwise we can get overlap with the general instance for ParserState m.
2017-02-17Markdown reader: Use logMessage instead of report.John MacFarlane1-5/+7
2017-02-17Fixed repeated log messages in RST reader.John MacFarlane1-13/+14
See #3447. To complete fixes on this issue, we need to do the same for the other readers. Note that the changes required are minimal -- add reportLogMessages to the end of the main parser, and replace report with logMessage. (except for trace)
2017-02-15Fix indirect hyperlink targets. Closes #512.John MacFarlane1-23/+33
2017-02-14LaTeX reader: include contents of `\parbox`.John MacFarlane1-0/+1
2017-02-14Removed unnecessary import.John MacFarlane1-1/+1
2017-02-13LaTeX reader: properly handle column prefixes/suffixes.John MacFarlane1-12/+33
For example, in \begin{tabular}{>{$}l<{$}>{$}l<{$} >{$}l<{$}} each cell will be interpreted as if it has a `$` before its content and a `$` after (math mode).
2017-02-11RST reader: Support `.. line-block` directive.John MacFarlane1-2/+7
This is deprecated but may still be in older documents.