aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Org
AgeCommit message (Collapse)AuthorFilesLines
2019-11-20Fix typos (#5919)Brian Wignall1-1/+1
2019-11-12Switch to new pandoc-types and use Text instead of String [API change].despresc9-320/+338
PR #5884. + Use pandoc-types 1.20 and texmath 0.12. + Text is now used instead of String, with a few exceptions. + In the MediaBag module, some of the types using Strings were switched to use FilePath instead (not Text). + In the Parsing module, new parsers `manyChar`, `many1Char`, `manyTillChar`, `many1TillChar`, `many1Till`, `manyUntil`, `mantyUntilChar` have been added: these are like their unsuffixed counterparts but pack some or all of their output. + `glob` in Text.Pandoc.Class still takes String since it seems to be intended as an interface to Glob, which uses strings. It seems to be used only once in the package, in the EPUB writer, so that is not hard to change.
2019-10-27Org reader: fix parsing of empty comment linesAlbert Krewinkel1-1/+3
Comment lines in Org-mode can be completely empty; both of these line should produce no output: # a comment # The reader used to produce a wrong result for the latter, but ignores that line as well now. Fixes: #5856
2019-09-08Org reader: modify handling of example blocks. (#5717)Brian Leung2-14/+43
* Org reader: allow the `-i` switch to ignore leading spaces. * Org reader: handle awkwardly-aligned code blocks within lists. Code blocks in Org lists must have their #+BEGIN_ aligned in a reasonable way, but their other components can be positioned otherwise.
2019-08-26Fix inline parsing in grid table cells.John MacFarlane1-1/+1
* T.P.Parsing: Change type of `setLastStrPos` so it takes a `Maybe SourcePos` rather than a `SourcePos`. [API change] * T.P.Parsing: Make `parseFromString'` and `gridTableWith` and `gridTableWith'` polymorphic in the parser state, constraining it with `HasLastStrPosition`. [API change] Closes #5708.
2019-07-22Org reader: accept ATTR_LATEX in block attributesAlbert Krewinkel1-3/+11
Attributes for LaTeX output are accepted as valid block attributes; however, their values are ignored. Fixes: #5648
2019-07-02Fix redundant constraint warnings. (#5625)Pete Ryland1-1/+1
2019-05-13Org reader: fix planning elements in headers level 3 and higherAlbert Krewinkel1-1/+1
Planning info is now always placed before the subtree contents. Previously, the planning info was placed after the content if the header's subtree was converted to a list, which happens with headers of level 3 and higher per default. Fixes: #5494
2019-05-13Org reader: omit, but warn about unknown export optionsAlbert Krewinkel2-4/+14
Unknown export options are properly ignored and omitted from the output.
2019-05-05Org reader: prefer plain symbols over math symbolsAlbert Krewinkel1-1/+1
Symbols like `\alpha` are output plain and unemphasized, not as math. Fixes: #5483
2019-05-05Org reader: recognize emphasis after TODO/DONE keywordAlbert Krewinkel1-1/+3
Fixes: #5484
2019-03-01Remove license boilerplate.John MacFarlane9-160/+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 Krewinkel9-18/+18
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-30Org reader: add support for #+SELECT_TAGS.leungbk4-23/+78
2019-01-30Org reader: separate filtering logic from conversion function.leungbk2-8/+11
2019-01-07Org reader: allow for case of :minlevel == 0.John MacFarlane1-1/+3
See #5190.
2019-01-07Org reader: handle `minlevel` option differently. (#5190)Brian Leung1-3/+1
When `minlevel` exceeds the original minimum level observed in the file to be included, every heading should be shifted rightward.
2019-01-01Org reader: fix self-link parsing regressionAlbert Krewinkel1-5/+6
Fixes a regression introduced by the previous commit.
2019-01-01Org reader: fix treatment of links to imagesAlbert Krewinkel2-13/+16
Links with descriptions which are pointing to images are no longer read as inline images, but as proper links. Fixes: #5191
2019-01-01Org reader: hlintAlbert Krewinkel1-2/+2
2018-12-31Remove unused HasHeaderMap (#5175)Alexander1-8/+2
It is updated by some readers, but never actually used.
2018-12-17Replace read with safeRead. Closes #5162.John MacFarlane1-1/+1
2018-10-22Add enclosedByPair1 and change relevant invocations.leungbk1-7/+13
2018-10-22Add space after brace.leungbk1-1/+1
2018-10-05Org reader: fix behavior for successive calls of `#+EXCLUDE_TAGS`. (#4951)Brian Leung2-8/+13
Calling `#+EXCLUDE_TAGS` multiple times should preserve the status of the previously declared tags.
2018-10-05Org reader: Add partial support for `#+EXCLUDE_TAGS` option. (#4950)Brian Leung4-7/+32
Closes #4284. Headers with the corresponding tags should not appear in the output. If one or more of the specified tags contains a non-tag character like `+`, Org-mode will not treat that as a valid tag, but will nonetheless continue scanning for valid tags. That behavior is not replicated in this patch; entering `cat+dog` as one of the entries in `#+EXCLUDE_TAGS` and running the file through Pandoc will cause the parser to fail and result in the only excluded tag being the default, `noexport`.
2018-10-04Add lookupMeta* functions to Text.Pandoc.Writers.Shared (#4907)Mauro Bieg1-8/+1
Remove exported functions `metaValueToInlines`, `metaValueToString`. Add new exported functions `lookupMetaBool`, `lookupMetaBlocks`, `lookupMetaInlines`, `lookupMetaString`. Use these whenever possible for uniformity in writers. API change (major, because of removed function `metaValueToInlines`. `metaValueToString` wasn't in any released version.)
2018-09-28Parse empty argument array in inline src blocks.leungbk1-1/+2
`enclosedByPair` alone does not the handle the empty array properly since it uses `many1Till`.
2018-09-26Force inline code blocks to honor export options.leungbk3-6/+8
`exportsCode` is moved from `Blocks.hs` to `Shared.hs` and exported accordingly.
2018-09-06Org reader: respect export option `p` for planning infoAlbert Krewinkel3-2/+28
Inclusion of planning info (*DEADLINE*, *SCHEDULED*, and *CLOSED*) can be controlled via the `p` export option: setting the option to `t` will add all planning information in a *Plain* block below the respective headline.
2018-09-06Org reader internals: disable some GHC extensionsAlbert Krewinkel1-26/+32
The RecordWildCards and ViewPatterns language extensions can be used to shorten code, but usually also makes it harder to read. The DocumentTree module was hence refactored and no longer relies on these extensions.
2018-09-05Org reader: strip planning info from outputAlbert Krewinkel1-1/+35
Planning info is parsed, but not included in the output (as is the default with Emacs Org-mode). Fixes: #4867
2018-07-23Org reader: fix parsers relying on parseFromStringAlbert Krewinkel1-4/+3
Emphasis was not parsed when it followed directly after some block types (e.g., lists). The org reader uses a wrapper for the `parseFromString` function to handle org-specific state. The last position of a character allowed before emphasis was reset incorrectly in this wrapper. Emphasized text was not recognized when placed directly behind a block which the reader parses using `parseFromString`. Fixes: #4784
2018-07-02Spellcheck commentsAlexander Krotov2-2/+2
2018-05-09Org reader: fix image filename recognitionAlbert Krewinkel1-6/+7
Use a function from the *filepath* library to check whether a string is a valid file name. The custom validity checker that was used before gave wrong results, e.g. for absolute file paths on Windows (kawabata/ox-pandoc#52).
2018-05-07Use Data.Maybe.fromMaybeAlexander Krotov1-6/+3
2018-03-18Removed unnecessary import.John MacFarlane1-2/+0
2018-03-18Use NoImplicitPrelude and explicitly import Prelude.John MacFarlane9-0/+18
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 MacFarlane3-3/+0
2018-03-15Remove redundant import.John MacFarlane1-1/+1
2018-03-13Require pandoc-types 1.17.4.John MacFarlane2-2/+2
And a few tweaks related to the Semigroups/Monoid change. Closes #4448.
2018-02-21Org reader: allow changing emphasis syntaxAlbert Krewinkel3-11/+39
The characters allowed before and after emphasis can be configured via `#+pandoc-emphasis-pre` and `#+pandoc-emphasis-post`, respectively. This allows to change which strings are recognized as emphasized text on a per-document or even per-paragraph basis. The allowed characters must be given as (Haskell) string. #+pandoc-emphasis-pre: "-\t ('\"{" #+pandoc-emphasis-post: "-\t\n .,:!?;'\")}[" If the argument cannot be read as a string, the default value is restored. Closes: #4378
2018-01-19hlint code improvements.John MacFarlane1-1/+1
2018-01-05Update copyright notices to include 2018Albert Krewinkel9-18/+18
2017-12-28Org reader: support minlevel option for includesAlbert Krewinkel1-14/+37
The level of headers in included files can be shifted to a higher level by specifying a minimum header level via the `:minlevel` parameter. E.g. `#+include: "tour.org" :minlevel 1` will shift the headers in tour.org such that the topmost headers become level 1 headers. Fixes: #4154
2017-12-20Org reader: fix asterisks-related parsing errorAlbert Krewinkel1-1/+1
A parsing error was fixed which caused the org reader to fail when parsing a paragraph starting with two or more asterisks. Fixes: #4180
2017-11-22Org reader: allow empty list itemsAlbert Krewinkel2-45/+42
Fixes: #4090
2017-10-27Automatic reformating by stylish-haskell.John MacFarlane1-6/+5
2017-10-27Consistent underline for Readers (#2270)hftf1-2/+2
* Added underlineSpan builder function. This can be easily updated if needed. The purpose is for Readers to transform underlines consistently. * Docx Reader: Use underlineSpan and update test * Org Reader: Use underlineSpan and add test * Textile Reader: Use underlineSpan and add test case * Txt2Tags Reader: Use underlineSpan and update test * HTML Reader: Use underlineSpan and add test case
2017-10-08Org reader: end footnotes after two blank linesAlbert Krewinkel1-4/+5
Footnotes can not only be terminated by the start of a new footnote or a header, but also by two consecutive blank lines.