aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
AgeCommit message (Collapse)AuthorFilesLines
2020-02-07Resolve HLint warningsAlbert Krewinkel17-113/+113
All warnings are either fixed or, if more appropriate, HLint is configured to ignore them. HLint suggestions remain. * Ignore "Use camelCase" warnings in Lua and legacy code * Fix or ignore remaining HLint warnings * Remove redundant brackets * Remove redundant `return`s * Remove redundant as-pattern * Fuse mapM_/map * Use `.` to shorten code * Remove redundant `fmap` * Remove unused LANGUAGE pragmas * Hoist `not` in Text.Pandoc.App * Use fewer imports for `Text.DocTemplates` * Remove redundant `do`s * Remove redundant `$`s * Jira reader: remove unnecessary parentheses
2020-02-07Various minor cleanups and refactoring (#6117)Joseph C. Sible4-23/+21
* Use concatMap instead of reimplementing it * Replace an unnecessary multi-way if with a regular if * Use sortOn instead of sortBy and comparing * Use guards instead of lots of indents for if and else * Remove redundant do blocks * Extract common functions from both branches of maybe Whenever both the Nothing and the Just branch of maybe do the same function, do that function on the result of maybe instead. * Use fmap instead of reimplementing it from maybe * Use negative forms instead of negating the positive forms * Use mapMaybe instead of mapping and then using catMaybes * Use zipWith instead of mapping over the result of zip * Use unwords instead of reimplementing it * Use <$ instead of <$> and const * Replace case of Bool with if and else * Use find instead of listToMaybe and filter * Use zipWithM instead of mapM and zip * Inline lambda wrappers into the real functions * We get zipWithM from Text.Pandoc.Writers.Shared * Use maybe instead of fromMaybe and fmap I'm not sure how this one slipped past me. * Increase a bit of indentation
2020-02-05Fix --number-offset with HTML TOC.John MacFarlane1-10/+19
Eventually it would be worth adding a parameter to makeSections so this could be done at that level; then it would also affect other writers that construct TOC manually.
2020-02-05MediaWiki writer: prevent triple `[[[`.John MacFarlane1-1/+11
This confuses mediawiki's parser. So we insert a `<nowiki/>` no-op between a literal `[` and a link. Closes #6119.
2020-02-03Swap suboptimal uses of maybe and fromMaybe (#6111)Joseph C. Sible3-10/+10
Anywhere "maybe" is used with "id" as its second argument, using "fromMaybe" instead will simplify the code. Conversely, anywhere "fromMaybe" is used with the result of "fmap" or "<$>" as its second argument, using "maybe" instead will simplify the code.
2020-02-03Fix duplicate frame classes in LaTeX/Beamer output.John MacFarlane1-2/+2
Close #6107.
2020-01-19Docx writer: fix regression with Compact style on tight lists. (#6073)John MacFarlane1-1/+9
Starting in 2.8, the docx writer no longer distinguishes between tight and loose lists, since the Compact style is omitted. This is a side-effect of the fix to #5670, as explained in the changelog: + Preserve built-in styles in DOCX with custom style (Ben Steinberg, #5670). This change prevents custom styles on divs and spans from overriding styles on certain elements inside them, like headings, blockquotes, and links. On those elements, the "native" style is required for the element to display correctly. This change also allows nesting of custom styles; in order to do so, it removes the default "Compact" style applied to Plain blocks, except when inside a table. This patch fixes the problem by extending the exception currently offered to Plain blocks inside tables to Plain blocks inside list items. Closes #6072.
2020-01-12HTML writer: fix duplicate attributes on headings.John MacFarlane1-9/+10
Another regression from 2.7.x. Closes #6062.
2020-01-07Jira writer: fix output of table headersAlbert Krewinkel1-4/+4
Headers were missing from tables. Fixes: #6035
2020-01-07Fix regression in handling of columns in beamer slides.John MacFarlane1-5/+6
Columns in title slides were causing problems with slide division. Closes #6033.
2020-01-07Reveal.js writer: restore old behavior for 2D nesting.John MacFarlane1-11/+17
The fix to #6030 actually changed behavior, so that the 2D nesting occurred at slide level N-1 and N, instead of at the top-level section. This commit restores the 2.7.3 behavior. If there are more than 2 levels, the top level is horizontal and the rest are collapsed to vertical. Closes #6032.
2020-01-05Fix regression in beamer slide structure with certain slide levels.John MacFarlane1-8/+17
Closes #6030.
2020-01-05Fix revealjs slide structure regression with certain slide levels.John MacFarlane1-6/+8
Partially addresses #6030.
2020-01-04HTML writer: Add newlines to make slide show output more readable.John MacFarlane1-6/+8
2020-01-03Org writer: remove extra spaces from table cellsAlbert Krewinkel1-1/+1
Closes: #6024
2020-01-01LaTeX writer: properly handle unnumbered headings level 4+.John MacFarlane1-1/+1
Closes #6018. Previously the `\paragraph` command was used instead of `\paragraph*` for unnumbered level 4 headings.
2019-12-21HTML writer: more tweaks to avoid round-trip failures...John MacFarlane1-2/+5
having to do with makeSections.
2019-12-21Fix regression with --number-sections.John MacFarlane1-2/+1
Starting with 2.8, `--number-sections` also had the effect of `--section-divs`, even if `--section-divs` was not specified.
2019-12-20Jira writer: use jira-wiki-markup rendererAlbert Krewinkel1-266/+222
Pandoc's AST is translated into the Jira AST, which is then rendered by the dedicated Jira printer. The following improvements are included in this change: - non-jira raw blocks are fully discarded instead of showing as blank lines; - table cells can contain multiple blocks; - unnecessary blank lines are removed from the output; - markup chars within words are properly surrounded by braces; - preserving soft linebreaks via `--wrap=preserve` is supported. Note that backslashes are rendered as HTML entities, as there appears no alternative to produce a plain backslash if it is followed by markup. This may cause problems when used with confluence, where rendering seems to fail in this case. Closes: #5926
2019-12-17Improved --toc generation.John MacFarlane3-9/+5
2019-12-17Improved makeSections so we don't get doubled attributes.John MacFarlane1-1/+2
Closes #5986.
2019-12-07Fix --toc-depth regression in 2.8.John MacFarlane1-3/+3
Closes #5967.
2019-12-05HTML writer: add task-list class to ul if all elements are task list items.John MacFarlane1-1/+10
This will allow styling unordered task lists in a way that omits the bullet.
2019-11-27Remove redundant import.John MacFarlane1-1/+0
2019-11-27LaTeX writer - hlint.John MacFarlane1-29/+24
2019-11-27HTML writer: hlint improvements.John MacFarlane1-25/+22
2019-11-27Removed useless cpp for old versions of blaze.John MacFarlane1-14/+0
2019-11-27Removed unneeded pragma.John MacFarlane1-1/+0
2019-11-25EPUB writer: Fix regression with `--css option.John MacFarlane1-9/+13
Closes #5937.
2019-11-25RST writers: Use grid tables for 1-column tables.John MacFarlane1-1/+1
With simple tables, we have a clash with heading syntax. Closes #5936.
2019-11-22Jira writer: improve escaping of special chars (#5925)Albert Krewinkel1-18/+9
Backslash-escaping is used instead of HTML entities, as escaped characters are easier to read this way. Furthermore, Confluence, which seems to use a subset of Jira markup, seems to get confused by HTML entities.
2019-11-21TEI writer: don't strip hash from internal links.John MacFarlane1-6/+2
Closes #5922.
2019-11-19Improve markdown escaping in list items.John MacFarlane1-27/+25
Closes #5918.
2019-11-16Ms writer: boldface definition terms in DefinitionLists.John MacFarlane1-1/+2
Like LaTeX, ConTeXt.
2019-11-16ConTeXt writer: set csl-hanging-ident variable if needed.John MacFarlane1-2/+6
2019-11-16ConTeXt writer: Use special environment for CSL references.John MacFarlane1-0/+8
2019-11-16ConTeXt writer: use braces, not start/stop, for inline language tags.John MacFarlane1-2/+2
This prevents unwanted gobbling of spaces.
2019-11-15RST writer: Improve spacing for tables with no width information.John MacFarlane2-6/+26
If a simple table would be too wide, we use a grid table. The code for generating grid tables has been adjusted to give more intelligent column widths when widths aren't given. (This also affects the markdown writer.) Closes #5899.
2019-11-14Writers.Shared: Clean up code for adding metadata to variables.John MacFarlane1-10/+9
2019-11-14RST writer: fix backslash escaping after stringsAlbert Krewinkel1-2/+2
The check whether a complex inline element following a string must be escaped, now depends on the last character of the string instead of the first. Fixes: #5906
2019-11-13Ensure there's a blank line before RST tables.John MacFarlane1-4/+5
Closes #5898.
2019-11-12Switch to new pandoc-types and use Text instead of String [API change].despresc39-2601/+2687
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-11-11Fix typos (#5896)Brian Wignall1-1/+1
2019-11-11Change the implementation of `htmlSpanLikeElements` and implement `<dfn>` ↵Florian Beeres1-2/+4
(#5882) * Add HTML Reader support for `<dfn>`, parsing this as a Span with class `dfn`. * Change `htmlSpanLikeElements` implementation to retain classes, attributes and inline content.
2019-11-07Fix list fields in Opt so they aren't reversed.John MacFarlane1-2/+6
Previously optIncludeInHeader, etc. were in reverse order. This has been changed to promote #5881. Note also that the `sourcefile` variable used to be sometimes a string, sometimes a list (when there was more than one). Now it is always a list.
2019-11-04HTML Reader/Writer - Add support for <var> and <samp> (#5861)Amogh Rathore1-6/+15
Closes #5799
2019-11-03EPUB writer: ensure that `lang` variable is set on all chapters.John MacFarlane1-3/+5
2019-11-03Place caption before table in OpenDocument format. (#5869)Dmitry Pogodin1-3/+5
Closes #5681.
2019-10-31Jira writer: remove extraneous newline after single-line block quotesAlbert Krewinkel1-1/+1
See #5858
2019-10-29T.P.W.Shared: Changed gridTables so it does better at...John MacFarlane1-16/+20
...keeping the widths of columns. See #4320. Adjust test case for #4320.