summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Parsing.hs
Commit message (Collapse)AuthorAge
* Updated copyright notices to -2015. Closes #2111.John MacFarlane2015-04-26
|
* Revert "Merge pull request #1947 from mpickering/Fmonad"John MacFarlane2015-04-18
| | | | | | | | | | | | | Closes #2062. This reverts commit c302bdcdbe97b38721015fe82403b2a8f488a702, reversing changes made to b983adf0d0cbc98d2da1e2751f46ae1f93352be6. Conflicts: src/Text/Pandoc/Parsing.hs src/Text/Pandoc/Readers/Markdown.hs src/Text/Pandoc/Readers/Org.hs src/Text/Pandoc/Readers/RST.hs
* Merge pull request #1954 from mcmtroffaes/feature/citekey-firstchar-alphanumJohn MacFarlane2015-04-17
|\ | | | | Allow digit as first character of a citation key.
| * Allow digit as first character of a citation key.Matthias C. M. Troffaes2015-02-18
| | | | | | | | | | | | | | | | * Update parser to recognize citation keys starting with a digit. * Update documentation accordingly. * Test case added. See https://github.com/jgm/pandoc-citeproc/issues/97
* | MD Reader: Smart `'` after inline mathNikolay Yakimov2015-04-18
| | | | | | | | | | | | | | | | | | | | | | | | Closes #1909. Adds new parser combinator to Parsing.hs `a <+?> b` : if a succeeds, applies b and mappends output (if any) to result of a. If b fails, it's just a, if a fails, whole expression fails.
* | Add Text.Pandoc.Error module with PandocError typeMatthew Pickering2015-02-18
| |
* | Factor out "returnState" into Parsing moduleMatthew Pickering2015-02-18
| |
* | Generalise signature of addWarningMatthew Pickering2015-02-18
| |
* | Add check to see whether in a footnote to ParserState (to avoid circular ↵Matthew Pickering2015-02-18
| | | | | | | | footnotes)
* | Remove F monad from ParsingMatthew Pickering2015-02-18
| |
* | Changed parseWithWarnings to the more general returnWarnings parser transformerMatthew Pickering2015-02-18
| |
* | Added generalize function which can be used to lift specialised parsers.Matthew Pickering2015-02-18
|/ | | | Monad m => Parsec s st a -> Parsec T s st m a
* Text.Pandoc.Parsing: Change parseFromString to fail if not all input isMatthew Pickering2014-12-15
| | | | consumed.
* Merge pull request #1805 from bergey/rstJohn MacFarlane2014-12-15
|\ | | | | RST Reader - Improved Role Support
| * RST Reader: compute Attrs when role is definedDaniel Bergey2014-12-12
| | | | | | | | | | | | | | | | | | | | Move recursive role lookup from renderRole to addNewRole. The Attr value will be the same for every occurance of this role, so there's no reason to compute it every time. This allows simplifying the stateRstCustomRoles map considerably. We could go even further, and remove the fmt and attr arguments to renderRole, which are null except for custom roles.
| * expose warnings from RST reader; refactorDaniel Bergey2014-12-12
| | | | | | | | | | | | This commit moves some code which was only used for the Markdown Reader into a generic form which can be used for any Reader. Otherwise, it takes naming and interface cues from the preexisting Markdown code.
| * RST Reader: Warn about skipped directivesDaniel Bergey2014-12-08
| | | | | | | | move `addWarning` to Parsing.hs, so it can be used by Markdown & RST readers.
* | Fixe autolinks with following punctuation.John MacFarlane2014-12-14
|/ | | | | | Closes #1811. The price of this is that autolinked bare URIs can no longer contain `>` characters, but this is not a big issue.
* Parsing: fixed `inlineMath` so it handles `\text{..}` containing `$`.John MacFarlane2014-10-19
| | | | For example: `$x = \text{the $n$th root of $y$}`. Closes #1677.
* Use texmath 0.7 interface.John MacFarlane2014-08-04
|
* Parsing: Added isbn and pmid schemesMatthew Pickering2014-07-27
|
* Generalised more in Parsing.hs to enable the use of custom stateMatthew Pickering2014-07-26
|
* Exported runParserT and StreamMatthew Pickering2014-07-22
|
* Generalised readWith to readWithMMatthew Pickering2014-07-22
|
* Fix behavior of `markdown_attribute` extension.John MacFarlane2014-07-20
| | | | | | | | It now works as in PHP markdown extra. Setting `markdown="1"` on an outer tag affects all contained tags until it is reversed with `markdown="0"`. Closes #1378. Added `stateMarkdownAttribute` to `ParserState`.
* readWith: reverted generalization from f201bdcb.John MacFarlane2014-07-20
| | | | | We need input to be a string so we can print the offending line on an error.
* Parsing: Simplified dash and ellipsis.John MacFarlane2014-07-12
| | | | | | | | | | | | | | | | | | This originated with @dubiousjim's observation in #1419 that there was a typo in the definition of enDash. It returned an em dash character instead of an en dash. I thought about why this had not been noticed before, and realized that en dashes were just being parsed as regular symbols. That made me realize that, now that we no longer have dedicate EnDash, EmDash, and Ellipses inline elements, as we used to in pandoc, we no longer need to parse the unicode characters specially. This allowed a considerable simplification of the code. Partially resolves #1419.
* Removed space at ends of lines in source.John MacFarlane2014-07-12
|
* Removed inline fmap from Parsing.hsMatthew Pickering2014-07-11
| | | | Replaced all inline occurences of fmap with the more idiomatic (<$>).
* Removed (>>~) functionMatthew Pickering2014-07-11
| | | | | | This function is equivalent to the more general (<*) which is defined in Control.Applicative. This change makes pandoc code easier to understand for those not familar with the codebase.
* Generalised all functions in Parsing.hsMatthew Pickering2014-07-11
| | | | | Before it wasn't possible to use these general combinators with the ParsecT transformer but with the more general types this is now possible.
* `Parsing`: Added `stateInHtmlBlock` to `ParserState`.John MacFarlane2014-07-07
| | | | | This is used to keep track of the ending tag we're waiting for when we're parsing inside HTML block tags.
* Markdown reader: inline math must have nonspace before final `$`.John MacFarlane2014-05-27
| | | | Closes #1313.
* Move `citeKey` from Readers.Markdown to ParsingAlbert Krewinkel2014-05-14
| | | | | The function can be used by other readers, so it is made accessible for all parsers.
* Introduce class HasLastStrPosition, generalize functionsAlbert Krewinkel2014-05-14
| | | | | | | | Both `ParserState` and `OrgParserState` keep track of the parser position at which the last string ended. This patch introduces a new class `HasLastStrPosition` and makes the above types instances of that class. This enables the generalization of functions updating the state or checking if one is right after a string.
* Update copyright notices for 2014, add missing noticesAlbert Krewinkel2014-05-09
|
* LaTeX reader: Better error messages with include files.John MacFarlane2014-05-03
| | | | | | | | | | | | | | Closes #1274. Rewrote handleIncludes. We now report the actual source file and position where the error occurs, even if it is included. We do this by inserting special commands, `\PandocStartInclude` and `\PandocEndInclude`, that encode this information in the preprocessing phase. Also generalized the types of a couple functions from `Text.Pandoc.Parsing`.
* Changed the smart punctuation parser to return Inlines rather than an Inline ↵Matthew Pickering2014-04-01
| | | | element and updated files accordingly
* Parsing: Added stateCaption.John MacFarlane2014-03-25
| | | | This is primarily for use in the LaTeX reader, so far.
* Parsing: Added HasMacros, simplified other typeclasses.John MacFarlane2014-03-25
| | | | | Removed updateHeaderMap, setHeaderMap, getHeaderMap, updateIdentifierList, setIdentifierList, getIdentifierList.
* Whitespace change, and note:John MacFarlane2014-03-25
| | | | | Contrary to the previous commit message, there was no API change, since Text.Pandoc.Parsing is not an exposed module.
* API changes to HasReaderOptions, HasHeaderMap, HasIdentifierList.John MacFarlane2014-03-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously these were typeclasses of monads. They've been changed to be typeclasses of states. This ismplifies the instance definitions and provides more flexibility. This is an API change! However, it should be backwards compatible unless you're defining instances of HasReaderOptions, HasHeaderMap, or HasIdentifierList. The old getOption function should work as before (albeit with a more general type). The function askReaderOption has been removed. extractReaderOptions has been added. getOption has been given a default definition. In HasHeaderMap, extractHeaderMap and updateHeaderMap have been added. Default definitions have been given for getHeaderMap, putHeaderMap, and modifyHeaderMap. In HasIdentifierList, extractIdentifierList and updateIdentifierList have been added. Default definitions have been given for getIdentifierList, putIdentifierList, and modifyIdentifierList. The ultimate goal here is to allow different parsers to use their own, tailored parser states (instead of ParserState) while still using shared functions.
* Parsing: Make F an instance of Applicative. Closes #1138.John MacFarlane2014-03-24
|
* Clarified field values in RstCustomRoles.Merijn Verstraaten2014-02-15
|
* Enhanced Pandoc's support for rST roles.Merijn Verstraaten2014-02-15
| | | | | | | | | | | | | | | | rST parser now supports: - All built-in rST roles - New role definition - Role inheritance Issues/TODO: - Silently ignores illegal fields on roles - Silently drops class annotations for roles - Only supports :format: fields with a single format for :raw: roles, requires a change to Text.Pandoc.Definition.Format to support multiple formats. - Allows direct use of :raw: role, rST only allows indirect (i.e., inherited use of :raw:).
* HLint: use `elem` and `notElem`Henry de Valence2013-12-19
| | | | Replaces long conditional chains with calls to `elem` and `notElem`.
* HTML reader: Parse LaTeX math if appropriate options are set.John MacFarlane2013-12-06
| | | | | | * Moved inlineMath, displayMath from Markdown reader to Parsing. * Export them from Parsing. (API change.) * Generalize their types.
* Parsing: Generalized type of registerHeader, using new typeclasses.John MacFarlane2013-11-17
| | | | | | | | | New type classes HasReadeOptions, HasIdentifierList, HasHeaderMap. These allow certain common functions to be reused even in parsers that use custom state (instead of ParserState), such as the MediaWiki reader. Minor API bump.
* Factored out registerHeader from markdown reader, added to Parsing.John MacFarlane2013-09-01
| | | | | Text.Pandoc.Parsing now exports registerHeader, which can be used in other readers.
* Parsing: Added stateMeta' to ParserState.John MacFarlane2013-08-18
|