summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Shared.hs
Commit message (Collapse)AuthorAge
* hlint code improvements.John MacFarlane2018-01-19
|
* Update copyright notices to include 2018Albert Krewinkel2018-01-05
|
* API change: export blocksToInlines' from Text.Pandoc.Sharedmb212017-12-22
|
* Shared.blocksToInlines: rewrote using builder.John MacFarlane2017-12-02
| | | | | This gives us automatic normalization, so we don't get for example two consecutive Spaces.
* Add --strip-empty-paragraphs option.John MacFarlane2017-12-02
| | | | This works for any input format.
* make normalizeDate more forgiving (#4101)Mauro Bieg2017-11-28
| | | also parse two-digit days, e.g. "April 20, 2017"
* hlintAlexander Krotov2017-11-01
|
* Source code reformatting.John MacFarlane2017-10-29
|
* hlint suggestions.John MacFarlane2017-10-27
|
* Don't rely on syb when we don't need to.John MacFarlane2017-10-27
|
* Automatic reformating by stylish-haskell.John MacFarlane2017-10-27
|
* Consistent underline for Readers (#2270)hftf2017-10-27
| | | | | | | | | | | | | | * 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
* Remove openURL from Shared (API change).John MacFarlane2017-10-15
| | | | | | | | Now all the guts of openURL have been put into openURL from Class. openURL is now sensitive to stRequestHeaders in CommonState and will add these custom headers when making a request. It no longer looks at the USER_AGENT environment variable, since you can now set the `User-Agent` header directly.
* Shared.stringify, removeFormatting: handle Quoted better.John MacFarlane2017-10-08
| | | | | Previously we were losing the qutation marks in Quoted elements. See #3958.
* Added support for translations (localization) (see #3559).John MacFarlane2017-08-11
| | | | | | | | | | | | | | | | | | | | | | | | | | * readDataFile, readDefaultDataFile, getReferenceDocx, getReferenceODT have been removed from Shared and moved into Class. They are now defined in terms of PandocMonad primitives, rather than being primitve methods of the class. * toLang has been moved from BCP47 to Class. * NoTranslation and CouldNotLoudTranslations have been added to LogMessage. * New module, Text.Pandoc.Translations, exporting Term, Translations, readTranslations. * New functions in Class: translateTerm, setTranslations. Note that nothing is loaded from data files until translateTerm is used; setTranslation just sets the language to be used. * Added two translation data files in data/translations. * LaTeX reader: Support `\setmainlanguage` or `\setdefaultlanguage` (polyglossia) and `\figurename`.
* Expose getDefaultDataFile in both Shared and Class.John MacFarlane2017-08-10
|
* Move CR filtering from tabFilter to the readers.John MacFarlane2017-06-20
| | | | | | | | | | 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.
* Use Control.Monad.State.Strict throughout.John MacFarlane2017-06-17
| | | | | This gives 20-30% speedup and reduction of memory usage in most of the writers.
* Switched Writer types to use Text.John MacFarlane2017-06-11
| | | | | | | | | | | * XML.toEntities: changed type to Text -> Text. * Shared.tabFilter -- fixed so it strips out CRs as before. * Modified writers to take Text. * Updated tests, benchmarks, trypandoc. [API change] Closes #3731.
* Rewrote convertTabs to use Text not String.John MacFarlane2017-06-10
|
* Added eastAsianLineBreakFilter to Shared.John MacFarlane2017-05-30
| | | | This used to live in the Markdown reader.
* Shared.isURI: allow uppercase versions of known schemes.John MacFarlane2017-05-23
|
* Shared: Provide custom isURI that rejects unknown schemes [isURI]Albert Krewinkel2017-05-23
| | | | | | | | | | | | | | | | | | | We also export the set of known `schemes`. The new function replaces the function of the same name from `Network.URI`, as the latter did not check whether a scheme is well-known. E.g. MediaWiki wikis frequently feature pages with names like `User:John`. These links were interpreted as URIs, thus turning internal links into global links. This is prevented by also checking whether the scheme of a URI is frequently used (i.e. is IANA registered or an otherwise well-known scheme). Fixes: #2713 Update set of well-known URIs from IANA list All official IANA schemes (as of 2017-05-22) are included in the set of known schemes. The four non-official schemes doi, isbn, javascript, and pmid are kept.
* Update dates in copyright noticesAlbert Krewinkel2017-05-13
| | | | | This follows the suggestions given by the FSF for GPL licensed software. <https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>
* Added PandocHttpException, trap exceptions in fetching from URLs.John MacFarlane2017-05-07
| | | | Closes #3646.
* Remove https flag.John MacFarlane2017-05-07
| | | | | | | | | Supporting two completely different libraries for fetching from URLs makes it difficult to trap errors, because of different error types expected from the libraries. There's no clear reason not to build with these https-capable libraires.
* Error: Added PandocCouldNotFindDataFileError.John MacFarlane2017-04-15
| | | | | Use this instead of PandocAppError when appropriate. Removed exit code from PandocAppError, use 1 for all.
* Text.Pandoc.App: Throw errors rather than exiting.John MacFarlane2017-04-02
| | | | | | | | | | | | | | | | | These are caught (and lead to exit) in pandoc.hs, but other uses of Text.Pandoc.App may want to recover in another way. Added PandocAppError to PandocError (API change). This is a stopgap: later we should have a separate constructor for each type of error. Also fixed uses of 'exit' in Shared.readDataFile, and removed 'err' from Shared (API change). Finally, removed the dependency on extensible-exceptions. See #3548.
* Revert "Shared: export extractIds."John MacFarlane2017-03-12
| | | | This reverts commit 0ef1e51211cd35b1ddb54a5fe8bee4247f1e1801.
* Shared: export extractIds.John MacFarlane2017-03-12
| | | | This will be used to help with #1745.
* Removed normalizeSpaces from Text.Pandoc.Shared.John MacFarlane2017-03-10
| | | | | | | Rewrote functions in RST reader and writer to avoid the need for it. Closes #1530.
* Shared.normalizeSpaces: strip off leading/trailing line breaks...John MacFarlane2017-03-10
| | | | ...not just spaces.
* Shared: remove 'warn'.John MacFarlane2017-02-24
| | | | | PDF writer: Use 'report' instead of 'warn', make it sensitive to verbosity settings.
* Shared.openURL: Changed type from an Either.John MacFarlane2017-02-23
| | | | Now it will just raise an exception to be trapped later.
* Simplify toRomanNumeral using guards (#3445)Alexander Krotov2017-02-14
|
* Allow user to specify User-Agent (#3421)Thenaesh Elango2017-02-05
| | | | | | | | | This commit enables users to specify the User-Agent header used when pandoc requests a document from a URL. This is done by setting an environment variable. For instance, one can do: USER_AGENT="..." ./pandoc -f html -t markdown http://example.com Signed-off-by: Thenaesh Elango <thenaeshelango@gmail.com>
* Shared: rename compactify', compactify'DL -> compactify, compactifyDL.John MacFarlane2017-01-27
|
* Removed Shared.compactify.John MacFarlane2017-01-27
| | | | Changed signatures on Parsing.tableWith and Parsing.gridTableWith.
* Removed writerIgnoreNotes.John MacFarlane2017-01-25
| | | | | | | | | Instead, just temporarily remove notes when generating TOC lists in HTML and Markdown (as we already did in LaTeX). Also export deNote from Text.Pandoc.Shared. API change in Shared and Options.WriterOptions.
* Factored out deNote in Shared.John MacFarlane2017-01-25
|
* Text.Pandoc.Shared: Removed fetchItem, fetchItem'.John MacFarlane2017-01-25
| | | | | Made changes where these are used, so that the version of fetchItem from PandocMonad can be used instead.
* Removed hush from Text.Pandoc.Shared.John MacFarlane2017-01-25
| | | | Not used anywhere.
* Removed `--normalize` option and normalization functions from Shared.John MacFarlane2017-01-25
| | | | | | | | | | | | | * Removed normalize, normalizeInlines, normalizeBlocks from Text.Pandoc.Shared. These shouldn't now be necessary, since normalization is handled automatically by the Builder monoid instance. * Remove `--normalize` command-line option. * Don't use normalize in tests. * A few revisions to readers so they work well without normalize.
* Shared: put err into MonadIO.John MacFarlane2017-01-25
|
* Shared: changed err and warn output.John MacFarlane2017-01-25
| | | | | Don't print program name in either case. Print [warning] for warnings.
* Shared.fetchItem: Better handling of protocol-relative URL.John MacFarlane2016-11-27
| | | | | | | | If URL starts with `//` and there is no "base URL" (as there would be if a URL were used on the command line), then default to http:. Closes #2635.
* Put 'warn' in MonadIO. Add warnings for math conversions in docx.John MacFarlane2016-11-22
|
* Merge pull request #3165 from hubertp-lshift/feature/odt-imageJohn MacFarlane2016-10-18
|\ | | | | [odt] images parser
| * Use bind function instead of pattern matchingHubert Plociniczak2016-10-17
| |
| * Basic support for images in ODT documentsHubert Plociniczak2016-10-12
| | | | | | | | | | Highly influenced by the docx support, refactored some code to avoid DRY.