aboutsummaryrefslogtreecommitdiff
path: root/test/Tests
AgeCommit message (Collapse)AuthorFilesLines
2017-07-15Fix docx writer test for ghc 8.2.1.John MacFarlane1-1/+9
Workaround for different behavior of Data.Unique in different ghc versions.
2017-07-15Rearrange docx writer roundtrip test.John MacFarlane1-4/+4
I'm hoping this gives reproducible results on ghc 8.2.1.
2017-07-14Refactored compareOutput in docx writer testJohn MacFarlane1-7/+6
2017-07-12Muse writer: indent lists inside <quote> with at least one space (#3795)Alexander Krotov1-0/+11
2017-07-07Rewrote LaTeX reader with proper tokenization.John MacFarlane1-1/+2
This rewrite is primarily motivated by the need to get macros working properly. A side benefit is that the reader is significantly faster (27s -> 19s in one benchmark, and there is a lot of room for further optimization). We now tokenize the input text, then parse the token stream. Macros modify the token stream, so they should now be effective in any context, including math. Thus, we no longer need the clunky macro processing capacities of texmath. A custom state LaTeXState is used instead of ParserState. This, plus the tokenization, will require some rewriting of the exported functions rawLaTeXInline, inlineCommand, rawLaTeXBlock. * Added Text.Pandoc.Readers.LaTeX.Types (new exported module). Exports Macro, Tok, TokType, Line, Column. [API change] * Text.Pandoc.Parsing: adjusted type of `insertIncludedFile` so it can be used with token parser. * Removed old texmath macro stuff from Parsing. Use Macro from Text.Pandoc.Readers.LaTeX.Types instead. * Removed texmath macro material from Markdown reader. * Changed types for Text.Pandoc.Readers.LaTeX's rawLaTeXInline and rawLaTeXBlock. (Both now return a String, and they are polymorphic in state.) * Added orgMacros field to OrgState. [API change] * Removed readerApplyMacros from ReaderOptions. Now we just check the `latex_macros` reader extension. * Allow `\newcommand\foo{blah}` without braces. Fixes #1390. Fixes #2118. Fixes #3236. Fixes #3779. Fixes #934. Fixes #982.
2017-06-29Added parameter for user data directory to runLuaFilter.John MacFarlane1-2/+2
in Text.Pandoc.Lua. Also to pushPandocModule. This change allows users to override pandoc.lua with a file in their local data directory, adding custom functions, etc. @tarleb, if you think this is a bad idea, you can revert this. But in general our data files are all overridable.
2017-06-28Muse reader: parse indented blockquotes (#3769)Alexander Krotov1-1/+6
2017-06-27HTML reader: Use the lang value of <html> to set the lang meta value. (#3765)bucklereed1-0/+6
* HTML reader: Use the lang value of <html> to set the lang meta value. * Fix for pre-AMP environments.
2017-06-26Muse writer: fix hlint errors (#3764)Alexander Krotov1-2/+2
2017-06-26Muse reader: fix horizontal rule parsing (#3762)Alexander Krotov1-1/+12
Do not parse 3 dashes as horizontal rule and allow whitespace after rule
2017-06-25Muse reader: Require space before and after '=' for code (#3758)Alexander Krotov1-0/+8
2017-06-20Muse reader: check that headers start at the first column (#3749)Alexander Krotov1-0/+17
2017-06-19Muse reader: fix list item continuation parsing (#3747)Alexander Krotov1-0/+13
2017-06-19Added Vimwiki reader (#3705).Yuchen Pei1-0/+4
* New module Text.Pandoc.Readers.Vimwiki, exporting readVimwiki [API change]. * New input format `vimwiki`. * New data file, `data/vimwiki.css`, for displaying the HTML produced by this reader and pandoc's HTML writer in the style of vimwiki's own HTML export.
2017-06-19Add Muse reader (#3620)Alexander Krotov1-0/+264
2017-06-11Revert "Command tests: small change to try to fix appveyor failures."John MacFarlane1-4/+3
This reverts commit 0ab26ac9ebb0196691ec064820eac4e640f0d52c. Failed experiment.
2017-06-11Command tests: small change to try to fix appveyor failures.John MacFarlane1-3/+4
2017-06-11Switched Writer types to use Text.John MacFarlane12-19/+30
* 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.
2017-06-10Changed all readers to take Text instead of String.John MacFarlane11-576/+598
Readers: Renamed StringReader -> TextReader. Updated tests. API change.
2017-05-31Org reader: respect export option for tagsAlbert Krewinkel1-0/+6
Tags are appended to headlines by default, but will be omitted when the `tags` export option is set to nil. Closes: #3713
2017-05-31Org reader: include tags in headlinesAlbert Krewinkel1-17/+19
The Emacs default is to include tags in the headline when exporting. Instead of just empty spans, which contain the tag name as attribute, tags are rendered as small caps and wrapped in those spans. Non-breaking spaces serve as separators for multiple tags.
2017-05-28Org reader: Fix cite parsing behaviourHerwig Stuetz1-0/+36
Until now, org-ref cite keys included special characters also at the end. This caused problems when citations occur right before colons or at the end of a sentence. With this change, all non alphanumeric characters at the end of a cite key are ignored. This also adds `,` to the list of special characters that are legal in cite keys to better mirror the behaviour of org-export.
2017-05-27Org reader: subject full doc tree to headline transformationsAlbert Krewinkel1-2/+16
Emacs parses org documents into a tree structure, which is then post-processed during exporting. The reader is changed to do the same, turning the document into a single tree of headlines starting at levelĀ 0. Fixes: #3695
2017-05-25Test.Command: put stderr output at front, so it can be tested.John MacFarlane1-3/+3
2017-05-18Org reader: fix smart parsing behaviorAlbert Krewinkel1-2/+2
Parsing of smart quotes and special characters can either be enabled via the `smart` language extension or the `'` and `-` export options. Smart parsing is active if either the extension or export option is enabled. Only smart parsing of special characters (like ellipses and en and em dashes) is enabled by default, while smart quotes are disabled. This means that all smart parsing features will be enabled by adding the `smart` language extension. Fine-grained control is possible by leaving the language extension disabled. In that case, smart parsing is controlled via the aforementioned export OPTIONS only. Previously, all smart parsing was disabled unless the language extension was enabled.
2017-05-12Replace `repeat' and `take' with `replicate'Alexander Krotov1-1/+1
2017-05-07Muse writer: Indent tables with one space (#3649)Alexander Krotov1-9/+9
It is required to trigger Muse table rendering.
2017-05-07Use fewer quickcheck tests for lua tests, to speed things up.John MacFarlane1-3/+3
2017-05-06Org reader: support macrosAlbert Krewinkel1-0/+18
Closes: #3401
2017-04-30Lua filter: fall-back to global filters when none is returnedAlbert Krewinkel1-0/+6
The implicitly defined global filter (i.e. all element filtering functions defined in the global lua environment) is used if no filter is returned from a lua script. This allows to just write top-level functions in order to define a lua filter. E.g function Emph(elem) return pandoc.Strong(elem.content) end
2017-04-23Org reader: allow multi-word arguments to src block paramsAlbert Krewinkel1-0/+9
The reader now correctly parses src block parameter list even if parameter arguments contain multiple words. Closes: #3477
2017-04-23Org reader: stop adding rundoc prefix to src paramsAlbert Krewinkel1-33/+26
Source block parameter names are no longer prefixed with *rundoc*. This was intended to simplify working with the rundoc project, a babel runner. However, the rundoc project is unmaintained, and adding those markers is not the reader's job anyway. The original language that is specified for a source element is now retained as the `data-org-language` attribute and only added if it differs from the translated language.
2017-04-23Org reader: handle line numbering switch for src blocksAlbert Krewinkel1-0/+9
The line-numbering switch that can be given to source blocks (`-n` with an start number as an optional parameter) is parsed and translated to a class/key-value combination used by highlighting and other readers and writers.
2017-04-16Org reader: allow emphasized text to be followed by `[`Albert Krewinkel1-0/+10
Closes: #3577
2017-04-16Org reader: convert markup at beginning of footnotesAlbert Krewinkel1-0/+10
Closes: #3576
2017-04-14Lua filter: allow shorthand functions for math and quotedAlbert Krewinkel1-14/+21
Allow to use functions named `SingleQuoted`, `DoubleQuoted`, `DisplayMath`, and `InlineMath` in filters.
2017-04-13Use lua constructors to push meta valuesAlbert Krewinkel1-2/+6
2017-04-07Lua filter: improve doc filter performanceAlbert Krewinkel1-1/+9
Pandoc elements are pushed and pulled from the lua stack via custom instances.
2017-04-06Ensure correctness of StackValue instancesAlbert Krewinkel1-0/+28
2017-04-02Lua module: add readers submoduleAlbert Krewinkel1-0/+6
Plain text readers are exposed to lua scripts via the `pandoc.reader` submodule, which is further subdivided by format. Converting e.g. a markdown string into a pandoc document is possible from within lua: doc = pandoc.reader.markdown.read_doc("Hello, World!") A `read_block` convenience function is provided for all formats, although it will still parse the whole string but return only the first block as the result. Custom reader options are not supported yet, default options are used for all parsing operations.
2017-03-30Added JATS writer.John MacFarlane1-0/+3
* New module Text.Pandoc.Writer.JATS exporting writeJATS. * New output format `jats`. * Added tests. * Revised manual.
2017-03-23Initial addition of groff ms writer.John MacFarlane1-0/+3
* New module: Text.Pandoc.Writers.Ms. * New template: default.ms. * The writer uses texmath's new eqn writer to convert math to eqn format, so a ms file produced with this writer should be processed with `groff -ms -e` if it contains math.
2017-03-20Lua filters (#3514)Albert Krewinkel1-0/+34
* Add `--lua-filter` option. This works like `--filter` but takes pathnames of special lua filters and uses the lua interpreter baked into pandoc, so that no external interpreter is needed. Note that lua filters are all applied after regular filters, regardless of their position on the command line. * Add Text.Pandoc.Lua, exporting `runLuaFilter`. Add `pandoc.lua` to data files. * Add private module Text.Pandoc.Lua.PandocModule to supply the default lua module. * Add Tests.Lua to tests. * Add data/pandoc.lua, the lua module pandoc imports when processing its lua filters. * Document in MANUAL.txt.
2017-03-15Use tasty-golden for golden tests in Old.John MacFarlane1-39/+52
2017-03-14Command tests: just findPandoc once.John MacFarlane1-4/+4
2017-03-14Removed unneeded import.John MacFarlane1-1/+0
2017-03-14Got rid of distracting warning in test output.John MacFarlane1-2/+2
2017-03-14Small test plumbing improvement.John MacFarlane1-11/+11
2017-03-14Use tasty for tests rather than test-framework.John MacFarlane26-131/+128
2017-03-10Add Muse writer (#3489)Alexander Krotov2-0/+276
* Add Muse writer * Advertise new Muse writer * Muse writer: add regressions tests