aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/RST.hs
AgeCommit message (Collapse)AuthorFilesLines
2018-09-20RST reader: fix bug with internal link targets.John MacFarlane1-1/+1
They were gobbling up indented content underneath. Closes #4919.
2018-09-18parse rST inlines containing newlines closing #4912danse1-1/+1
this eliminates a regression error introduced after pandoc 2.1.1, affecting rST inline parsing. see the issue for details
2018-08-29RSTR reader: don't skip link definitions after comments.John MacFarlane1-0/+1
Closes #4860.
2018-08-05RST reader: improve parsing of inline interpreted text roles.John MacFarlane1-12/+28
* Use a Span with class "title-reference" for the default title-reference role. * Use B.text to split up contents into Spaces, SoftBreaks, and Strs for title-reference. * Use Code with class "interpreted-text" instead of Span and Str for unknown roles. (The RST writer has also been modified to round-trip this properly.) * Disallow blank lines in interpreted text. * Backslash-escape now works in interpreted text. * Backticks followed by alphanumerics no longer end interpreted text. Closes #4811.
2018-07-24RST reader: remove support for nested inlines.danse1-17/+15
RST does not allow nested emphasis, links, or other inline constructs. Closes #4581, double parsing of links with URLs as link text. This supersedes the earlier fix for #4581 in 6419819b46c0d69c7024ba8aa4a6381cb311341c. Fixes #4561, a bug parsing with URLs inside emphasis. Closes #4792.
2018-07-21RST reader: fix double-link bug.John MacFarlane1-1/+8
Link labels containing raw URLs were parsed as autolinks, but links within links are not allowed. Closes #4581.
2018-04-26RST reader: fix anonymous redirects with backticks.John MacFarlane1-3/+8
Closes #4598.
2018-04-22RST reader: allow < 3 spaces indent under directives.John MacFarlane1-3/+7
Closes #4579.
2018-03-18Use NoImplicitPrelude and explicitly import Prelude.John MacFarlane1-0/+2
This seems to be necessary if we are to use our custom Prelude with ghci. Closes #4464.
2018-03-16Monoid/Semiground cleanup relying on custom Prelude.John MacFarlane1-1/+0
2018-03-14RST reader: Allow unicode bullet characters.John MacFarlane1-1/+1
Closes #4454.
2018-01-20RST reader: fix parsing of headers with trailing space.John MacFarlane1-1/+1
This was a regression in pandoc 2.0. Closes #4280.
2018-01-19hlint code improvements.John MacFarlane1-4/+4
2018-01-14RST reader: add aligned environment when needed in math.John MacFarlane1-2/+7
rst2latex.py uses an align* environment for math in `.. math::` blocks, so this math may contain line breaks. If it does, we put the math in an `aligned` environment to simulate rst2latex.py's behavior. Closes #4254.
2018-01-10RST reader: better handling for headers with an anchor.John MacFarlane1-2/+12
Instead of creating a div containing the header, we put the id directly on the header. This way header promotion will work properly. Closes #4240.
2018-01-05Update copyright notices to include 2018Albert Krewinkel1-2/+2
2017-12-24RST reader: allow empty list items (as docutils does).John MacFarlane1-2/+2
Closes #4193.
2017-12-14RST reader: more accurate parsing of references.John MacFarlane1-36/+24
Previously we erroneously included the enclosing backticks in a reference ID (closes #4156). This change also disables interpretation of syntax inside references, as in docutils. So, there is no emphasis in `my *link*`_
2017-11-14RST reader: better support for 'container' directive.John MacFarlane1-1/+3
Create a div, incorporate name attribute and classes. Closes #4066.
2017-10-29Source code reformatting.John MacFarlane1-6/+5
2017-10-29More hlint fixes.John MacFarlane1-50/+46
2017-10-27Automatic reformating by stylish-haskell.John MacFarlane1-21/+21
2017-09-30Removed writerSourceURL, add source URL to common state.John MacFarlane1-1/+1
Removed `writerSourceURL` from `WriterOptions` (API change). Added `stSourceURL` to `CommonState`. It is set automatically by `setInputFiles`. Text.Pandoc.Class now exports `setInputFiles`, `setOutputFile`. The type of `getInputFiles` has changed; it now returns `[FilePath]` instead of `Maybe [FilePath]`. Functions in Class that formerly took the source URL as a parameter now have one fewer parameter (`fetchItem`, `downloadOrRead`, `setMediaResource`, `fillMediaBag`). Removed `WriterOptions` parameter from `makeSelfContained` in `SelfContained`.
2017-08-27RST reader: Fixed `..include::` directive.John MacFarlane1-9/+9
Closes #3880.
2017-08-17RST reader/writer: support unknown interpreted text roles...John MacFarlane1-4/+2
...by parsing them as Span with "role" attributes. This way they can be manipulated in the AST. Closes #3407.
2017-08-10RST reader: implement csv-table directive.John MacFarlane1-45/+56
Most attributes are supported, including `:file:` and `:url:`. A (probably insufficient) test case has been added. Closes #3533.
2017-08-10RST reader: Basic support for csv-table directive.John MacFarlane1-0/+52
* Added Text.Pandoc.CSV, simple CSV parser. * Options still not supported, and we need tests. See #3533.
2017-08-09RST reader: reorganize block parsers for ~20% faster parsing.John MacFarlane1-3/+4
2017-08-09Removed spurious comments.John MacFarlane1-4/+0
2017-08-08RST reader: support :widths: attribute for table directive.John MacFarlane1-3/+13
2017-06-27RST reader: support anchors.John MacFarlane1-1/+23
E.g. `hello` .. _hello: paragraph This is supported by putting "paragraph" in a Div with id `hello`. Closes #262.
2017-06-27RST reader: Handle chained link definitions.John MacFarlane1-7/+20
For example, .. _hello: .. _goodbye: example.com Here both `hello` and `goodbye` should link to `example.com`. Fixes the first part of #262.
2017-06-20Move CR filtering from tabFilter to the readers.John MacFarlane1-1/+1
The readers previously assumed that CRs had been filtered from the input. Now we strip the CRs in the readers themselves, before parsing. (The point of this is just to simplify the parsers.) Shared now exports a new function `crFilter`. [API change] And `tabFilter` no longer filters CRs.
2017-06-10Changed all readers to take Text instead of String.John MacFarlane1-2/+5
Readers: Renamed StringReader -> TextReader. Updated tests. API change.
2017-05-28RST reader: use anyLineNewline in rawListItem (#3702)Alexander Krotov1-2/+2
2017-05-24Parsing: Provide parseFromString'.John MacFarlane1-25/+25
This is a verison of parseFromString specialied to ParserState, which resets stateLastStrPos at the end. This is almost always what we want. This fixes a bug where `_hi_` wasn't treated as emphasis in the following, because pandoc got confused about the position of the last word: - [o] _hi_ Closes #3690.
2017-05-23RST reader: reformatting (code line length).John MacFarlane1-23/+47
2017-05-23RST Reader: parse list table directive (#3688)keiichiro shikano1-1/+28
Closes #3432.
2017-05-22Move indentWith to Text.Pandoc.Parsing (#3687)Alexander Krotov1-9/+0
2017-05-20RST reader: make use of anyLineNewline (#3686)Alexander Krotov1-2/+1
2017-05-13Update dates in copyright noticesAlbert Krewinkel1-2/+2
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-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-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-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-04Stylish-haskell automatic formatting changes.John MacFarlane1-26/+26
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-02-28RST reader: implemented implicit internal header links.John MacFarlane1-18/+42
Cloess #3475.
2017-02-26RST reader: support scale and align attributes of images.John MacFarlane1-5/+25
Closes #2662.
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)