aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/RST.hs
AgeCommit message (Collapse)AuthorFilesLines
2019-09-29RST reader: don't strip final underscore from absolute URI.John MacFarlane1-3/+7
Partially addresses #5763.
2019-09-28Use Prelude.fail to avoid ambiguity with fail from GHC.Base.John MacFarlane1-1/+1
2019-09-22RST reader: Fixed parsing of indented blocks.John MacFarlane1-6/+9
We were requiring consistent indentation, but this isn't required by RST, as long as each nonblank line of the block has *some* indentation. Closes #5753.
2019-08-23RST reader: use title, not admonition-title, for admonition title.John MacFarlane1-1/+1
This puts RST reader into alignment with docbook reader.
2019-07-10RST reader: keep `name` property in `imgAttr`. (#5637)Brian Leung1-1/+1
Closes #5619.
2019-03-01Remove license boilerplate.John MacFarlane1-18/+0
The haddock module header contains essentially the same information, so the boilerplate is redundant and just one more thing to get out of sync.
2019-02-04Add missing copyright notices and remove license boilerplate (#5112)Albert Krewinkel1-2/+2
Quite a few modules were missing copyright notices. This commit adds copyright notices everywhere via haddock module headers. The old license boilerplate comment is redundant with this and has been removed. Update copyright years to 2019. Closes #4592.
2019-01-09RST reader: change treatment of `number-lines` directives. (#5207)Brian Leung1-15/+15
Directives of this type without numeric inputs should not have a `startFrom` attribute; with a blank value, the writers can produce extra whitespace.
2019-01-08Removed superfluous sourceCode class on code blocks.John MacFarlane1-7/+4
* These were added by the RST reader and, for literate Haskell, by the Markdown and LaTeX readers. There is no point to this class, and it is not applied consistently by all readers. See #5047. * Reverse order of `literate` and `haskell` classes on code blocks when parsing literate Haskell. Better if `haskell` comes first.
2019-01-08RST reader: handle sourcecode directive as synonynm for code.John MacFarlane1-1/+1
Closes #5204.
2018-12-31Remove unused HasHeaderMap (#5175)Alexander1-1/+0
It is updated by some readers, but never actually used.
2018-10-07RST reader: don't allow single-dash separator in headerless table.John MacFarlane1-1/+3
Closes #4382.
2018-10-07RST reader: pass through fields in unknown directives as div attributes.John MacFarlane1-17/+20
This commit also adds support for `class` and `name` attributes to directives in general. Closes #4715.
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