aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
AgeCommit message (Collapse)AuthorFilesLines
2017-05-16Org reader: replace `sequence . map` with `mapM`Albert Krewinkel2-3/+3
2017-05-16Org reader: put tree parsing code into dedicated moduleAlbert Krewinkel2-210/+262
2017-05-16Merge pull request #3671 from WUUUGI/horizont-spacingJohn MacFarlane1-1/+1
Added support for horizontal spacing in LaTeX
2017-05-15Textile reader: fix bug for certain links in table cells.John MacFarlane1-2/+5
Closes #3667.
2017-05-15Added support for horizontal spacing in LaTeX: parse \, to \8198 (six-per-em ↵Henri Werth1-1/+1
space)
2017-05-14Org reader: add basic file inclusion mechanismAlbert Krewinkel3-5/+43
Support for the `#+INCLUDE:` file inclusion mechanism was added. Recognized include types are *example*, *export*, *src*, and normal org file inclusion. Advanced features like line numbers and level selection are not implemented yet. Closes: #3510
2017-05-13Update dates in copyright noticesAlbert Krewinkel17-34/+35
This follows the suggestions given by the FSF for GPL licensed software. <https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>
2017-05-12Replace `repeat' and `take' with `replicate' once moreAlexander Krotov1-1/+1
2017-05-11Combine grid table parsersAlbert Krewinkel1-83/+1
The grid table parsers for markdown and rst was combined into one single parser, slightly changing parsing behavior of both parsers: - The markdown parser now compactifies block content cell-wise: pure text blocks in cells are now treated as paragraphs only if the cell contains multiple paragraphs, and as plain blocks otherwise. Before, this was true only for single-column tables. - The rst parser now accepts newlines and multiple blocks in header cells. Closes: #3638
2017-05-06Markdown reader: improved parsing of indented raw HTML blocks.John MacFarlane1-1/+7
Previously we inadvertently interpreted indented HTML as code blocks. This was a regression. We now seek to determine the indentation level of the contents of an HTML block, and (optionally) skip that much indentation. As a side effect, indentation may be stripped off of raw HTML blocks, if `markdown_in_html_blocks` is used. This is better than having things interpreted as indented code blocks. Closes #1841.
2017-05-06LaTeX reader: Better handling of comments inside math environments.John MacFarlane1-30/+43
This solves a problem with commented out `\end{eqnarray}` inside an eqnarray (among other things). Closes #3113.
2017-05-06Fix keyval funtion: pandoc did not parse options in braces correctly.… (#3642)schrieveslaach1-1/+1
* Fix keyval funtion: pandoc did not parse options in braces correctly. Additionally, dot, dash, and colon were no valid characters * Add | as possible option value * Improved code
2017-05-06Drop redundant import of sortAlbert Krewinkel1-1/+1
This was left in accidentally.
2017-05-06Org reader: support macrosAlbert Krewinkel3-1/+65
Closes: #3401
2017-05-03Org reader: support table.el tablesAlbert Krewinkel3-8/+18
Closes #3314
2017-05-02Generalize tableWith, gridTableWithAlbert Krewinkel1-3/+9
The parsing functions `tableWith` and `gridTableWith` are generalized to work with more parsers. The parser state only has to be an instance of the `HasOptions` class instead of requiring a concrete type. Block parsers are required to return blocks wrapped into a monad, as this makes it possible to use parsers returning results wrapped in `Future`s.
2017-05-03LaTeX reader: Add support for tabularx environment (#3632)schrieveslaach1-1/+6
2017-04-30Provide shared F monad functions for Markdown and Org readersAlbert Krewinkel3-42/+11
The `F` monads used for delayed evaluation of certain values in the Markdown and Org readers are based on a shared data type capturing the common pattern of both `F` types.
2017-04-30Add returnF to Text.Pandoc.ParsingAlexander Krotov2-3/+3
2017-04-30Org reader: Avoid creating nullMeta by applying setMeta directlyAlexander Krotov1-4/+1
2017-04-26LaTeX reader: Add basic support for hyphenat package (#3603)schrieveslaach1-1/+13
2017-04-26Simplify linkText in Text.Pandoc.Readers.TWiki (#3605)Alexander Krotov1-2/+2
Avoid constructing list of one element ([B.str url]) just to flatten it back with mconcat.
2017-04-26LaTeX reader: Add support for \vdots (#3607)schrieveslaach1-0/+1
2017-04-24LaTeX reader: better support for subfigure package.John MacFarlane1-5/+11
A figure with two subfigures turns into two pandoc figures; the subcaptions are used and the main caption ignored, unless there are no subcaptions. Closes #3577.
2017-04-24TWiki reader: remove unnecessary $ (#3597)Alexander Krotov1-1/+1
2017-04-23Org reader: allow multi-word arguments to src block paramsAlbert Krewinkel1-2/+5
The reader now correctly parses src block parameter list even if parameter arguments contain multiple words. Closes: #3477
2017-04-23Org reader: stop adding rundoc prefix to src paramsAlbert Krewinkel3-39/+24
Source block parameter names are no longer prefixed with *rundoc*. This was intended to simplify working with the rundoc project, a babel runner. However, the rundoc project is unmaintained, and adding those markers is not the reader's job anyway. The original language that is specified for a source element is now retained as the `data-org-language` attribute and only added if it differs from the translated language.
2017-04-23Org reader: handle line numbering switch for src blocksAlbert Krewinkel1-13/+57
The line-numbering switch that can be given to source blocks (`-n` with an start number as an optional parameter) is parsed and translated to a class/key-value combination used by highlighting and other readers and writers.
2017-04-23HTML reader: Revise treatment of li with id attribute.John MacFarlane1-2/+6
Previously we always added an empty div before the list item, but this created problems with spacing in tight lists. Now we do this: If the list item contents begin with a Plain block, we modify the Plain block by adding a Span around its contents. Otherwise, we add a Div around the contents of the list item (instead of adding an empty Div to the beginning, as before). Closes #3596.
2017-04-22Add siunitx Support (#3588)schrieveslaach1-0/+17
For example: ```latex \SI[round-precision=2]{1}{m} is equal to \SI{1000}{mm}. \SI[round-precision=2]{1}[\$]{} is equal to \SI{0.938094}{\euro} ```
2017-04-16Org reader: allow emphasized text to be followed by `[`Albert Krewinkel1-1/+1
Closes: #3577
2017-04-16Org reader: convert markup at beginning of footnotesAlbert Krewinkel1-1/+1
Closes: #3576
2017-04-15Docx reader: removed readDocxWithWarnings (API change).John MacFarlane1-9/+1
No longer necessary with pandoc 2.0 framework.
2017-04-14s/safed/saved/Alexander Krotov1-1/+1
2017-04-06Allow raw latex commands starting with `\start` in Markdown.John MacFarlane1-1/+2
Previously these weren't allowed because they were interpreted as starting ConTeXt environments, even without a corresponding \stop... Closes #3558.
2017-03-29lstinline with braces can be used (verb cannot be used with braces) (#3535)schrieveslaach1-1/+8
* Fix lstinline handling: lstinline with braces can be used (verb cannot be used with braces) * Use codeWith and determine the language from lstinline * Improve code * Add another test: convert lstinline without language option
2017-03-27LaTeX reader: add support for LaTeX subfiles package.schrieveslaach1-0/+1
Closes #3530.
2017-03-24Revert "LaTeX reader: be more picky about beamer angle arguments."John MacFarlane1-1/+1
This reverts commit b98a05d604ab4353c2e684beecf669b182d88906.
2017-03-24LaTeX reader: be more picky about beamer angle arguments.John MacFarlane1-1/+1
We now only allow them if they contain only numbers, spaces, `-`, and `,`.
2017-03-22Markdown reader: allow latex macro definitions indented 1-3 spaces.John MacFarlane1-1/+8
Previously they only worked if nonindented.
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.