aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/MediaWiki.hs
AgeCommit message (Collapse)AuthorFilesLines
2019-11-12Switch to new pandoc-types and use Text instead of String [API change].despresc1-99/+99
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-09-19MediaWiki: skip optional {{table}} template.John MacFarlane1-0/+1
See https://en.wikipedia.org/wiki/Template:Table Closes #5757.
2019-05-01MediaWiki reader: handle multiple attributes in table row (#5471)chinapedia1-2/+2
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-25MediaWiki reader: use `_` instead of `-` in auto-identifiers.John MacFarlane1-1/+6
Partially addresses #4731. We may not still be exactly matching mediawiki's algorithm for identifiers.
2018-12-31Remove unused HasHeaderMap (#5175)Alexander1-7/+0
It is updated by some readers, but never actually used.
2018-11-25MediaWiki reader internals: remove unnecessary bindingAlexander Krotov1-2/+1
2018-03-29Removed unused extensions (#4506)Anabra1-3/+1
2018-03-28Mediawiki reader: improve table parsing.John MacFarlane1-5/+18
This fixes detection of table attributes and also handles `!` characters in cells. Closes #4508.
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-01-05Update copyright notices to include 2018Albert Krewinkel1-2/+2
2017-11-11MediaWiki reader: hlintAlexander Krotov1-13/+13
2017-10-27Automatic reformating by stylish-haskell.John MacFarlane1-4/+4
2017-06-20Move CR filtering from tabFilter to the readers.John MacFarlane1-2/+3
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-19Separated tracing from logging.John MacFarlane1-3/+2
Formerly tracing was just log messages with a DEBUG log level. We now make these things independent. Tracing can be turned on or off in PandocMonad using `setTrace`; it is independent of logging. * Removed `DEBUG` from `Verbosity`. * Removed `ParserTrace` from `LogMessage`. * Added `trace`, `setTrace` to `PandocMonad`.
2017-06-10Changed all readers to take Text instead of String.John MacFarlane1-2/+3
Readers: Renamed StringReader -> TextReader. Updated tests. API change.
2017-05-25MediaWiki reader: don't do curly quotes inside `<tt>` contexts.John MacFarlane1-1/+10
Even if `+smart`. See #3585.
2017-05-25MediaWiki reader: Make smart double quotes depend on `smart` extension.John MacFarlane1-1/+3
Closes #3585.
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-03-12Issue warning for duplicate header identifiers.John MacFarlane1-0/+7
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-04Stylish-haskell automatic formatting changes.John MacFarlane1-27/+29
2017-02-21MediaWiki reader: ensure that list starts begin at left margin.John MacFarlane1-9/+18
Including when they're in tables or other list items. Closes #2606.
2017-02-21MediaWiki reader: fixed more table issues.John MacFarlane1-9/+7
Closes #2649.
2017-02-21MediaWiki reader: Allow blank line after table start.John MacFarlane1-1/+1
See #2649.
2017-02-21MediaWiki tables: allow extra hyphens after `|-` in tables.John MacFarlane1-1/+1
I didn't see this documented anywhere, but it seems to be allowed (and common). See #2649. This addresses some of the cases there, but not all.
2017-02-11Use new warnings throughout the code base.John MacFarlane1-4/+2
2017-02-10Added Text.Pandoc.Logging (exported module).John MacFarlane1-0/+1
This now contains the Verbosity definition previously in Options, as well as a new LogMessage datatype that will eventually be used instead of raw strings for warnings. This will enable us, among other things, to provide machine-readable warnings if desired. See #3392.
2017-01-25More logging-related changes.John MacFarlane1-6/+3
Class: * Removed getWarnings, withWarningsToStderr * Added report * Added logOutput to PandocMonad * Make logOutput streaming in PandocIO monad * Properly reverse getLog output Readers: * Replaced use of trace with report DEBUG. TWiki Reader: Put everything inside PandocMonad m. API changes.
2017-01-25Changes to verbosity in writer and reader options.John MacFarlane1-1/+1
API changes: Text.Pandoc.Options: * Added Verbosity. * Added writerVerbosity. * Added readerVerbosity. * Removed writerVerbose. * Removed readerTrace. pandoc CLI: The `--trace` option sets verbosity to DEBUG; the `--quiet` option sets it to ERROR, and the `--verbose` option sets it to INFO. The default is WARNING.
2017-01-25Readers: pass errors straight up to PandocMonad.Jesse Rosenthal1-2/+1
Since we've unified error types, we can just throw the same error at the toplevel.
2017-01-25Unify Errors.Jesse Rosenthal1-1/+2
2017-01-25Working on readers.Jesse Rosenthal1-71/+75
2017-01-19MediaWiki reader: improved handling of display math.John MacFarlane1-2/+3
Sometimes display math is indented with more than one colon. Previously we handled these cases badly, generating definition lists and missing the math. Closes #3362.
2017-01-05MediaWiki reader: Fix quotation mark parsing (#3336)tgkokk1-6/+3
Change MediaWiki reader's behavior when the smart option is parsed to match other readers' behavior. Fix #2012.
2016-10-02MediaWiki writer: transform filename with underscores in images.John MacFarlane1-1/+1
`foo bar.jpg` becomes `foo_bar.jpg`. This was already done for internal links, but it also needs to happen for images. Closes #3052.
2016-09-02Remove Compat.MonoidJesse Rosenthal1-1/+1
This was only necessary for GHC versions with base below 4.5 (i.e., ghc < 7.4).
2016-08-06Improved mediawiki reader's treatment of verbatim constructions.John MacFarlane1-7/+13
Previously these yielded strings of alternating Code and Space elements; we now incorporate the spaces into the Code. Emphasis etc. is still possible inside these. Closes #3055.
2016-08-06Fix for unquoted attribute values in mediawiki tables.John MacFarlane1-1/+1
Previously an unquoted attribute value in a table row could cause parsing problems. Fixes #3053 (well, proper rowspans and colspans aren't created, but that's a bigger limitation with the current Pandoc document model for tables).
2016-05-09Allow spaces before '!' in MediaWiki table headerroblabla1-1/+1
2016-01-22Changed type of Shared.uniqueIdent argument from [String] to Set String.John MacFarlane1-2/+3
This avoids performance problems in documents with many identically named headers. Closes #2671.
2016-01-02MediaWiki reader: interpret markup inside `<tt>`, `<code>`.John MacFarlane1-4/+6
Closes #2607.
2015-12-12Modified readers to emit SoftBreak when appropriate.John MacFarlane1-1/+2
2015-11-19Merge branch 'new-image-attributes' of https://github.com/mb21/pandoc into ↵John MacFarlane1-11/+19
mb21-new-image-attributes * Bumped version to 1.16. * Added Attr field to Link and Image. * Added `common_link_attributes` extension. * Updated readers for link attributes. * Updated writers for link attributes. * Updated tests * Updated stack.yaml to build against unreleased versions of pandoc-types and texmath. * Fixed various compiler warnings. Closes #261. TODO: * Relative (percentage) image widths in docx writer. * ODT/OpenDocument writer (untested, same issue about percentage widths). * Update pandoc-citeproc.
2015-11-09Restored Text.Pandoc.Compat.Monoid.John MacFarlane1-0/+1
Don't use custom prelude for latest ghc. This is a better approach to making 'stack ghci' and 'cabal repl' work. Instead of using NoImplicitPrelude, we only use the custom prelude for older ghc versions. The custom prelude presents a uniform API that matches the current base version's prelude. So, when developing (presumably with latest ghc), we don't use a custom prelude at all and hence have no trouble with ghci. The custom prelude no longer exports (<>): we now want to match the base 4.8 prelude behavior.
2015-11-09Revert "Use -XNoImplicitPrelude and 'import Prelude' explicitly."John MacFarlane1-1/+0
This reverts commit c423dbb5a34c2d1195020e0f0ca3aae883d0749b.
2015-11-08Use -XNoImplicitPrelude and 'import Prelude' explicitly.John MacFarlane1-0/+1
This is needed for ghci to work with pandoc, given that we now use a custom prelude. Closes #2503.
2015-10-14Use custom Prelude to avoid compiler warnings.John MacFarlane1-3/+1
- The (non-exported) prelude is in prelude/Prelude.hs. - It exports Monoid and Applicative, like base 4.8 prelude, but works with older base versions. - It exports (<>) for mappend. - It hides 'catch' on older base versions. This allows us to remove many imports of Data.Monoid and Control.Applicative, and remove Text.Pandoc.Compat.Monoid. It should allow us to use -Wall again for ghc 7.10.
2015-08-08MediaWiki reader: handle unquoted table attributes.John MacFarlane1-2/+2
Closes #2355.