Commit graph

9251 commits

Author SHA1 Message Date
John MacFarlane
005aba43df Travis: don't use -Wincomplete-uni-patterns. 2017-08-08 22:42:50 -07:00
John MacFarlane
2d47306b1f Travis: Don't use -Wcompat. 2017-08-08 22:40:38 -07:00
John MacFarlane
c3e6eacdc8 Travis: only use fancy warnings for recent ghc. 2017-08-08 21:24:55 -07:00
John MacFarlane
606a8e2af4 RST reader: support :widths: attribute for table directive. 2017-08-08 20:48:30 -07:00
John MacFarlane
2f0bff0f54 Use extra ghc warnings.
In addition to `-Wall`:
 `-Wincomplete-uni-patterns -Wincomplete-record-updates -Wredundant-constraints -Wcompat -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances`
2017-08-08 20:29:37 -07:00
John MacFarlane
34d3f25e87 Parsing: added gobbleSpaces.
This is a utility function to use in list parsing.
2017-08-08 20:07:06 -07:00
John MacFarlane
b1c2ada4e4 Removed redundant import. 2017-08-08 16:46:12 -07:00
Alexander
81224a3a73 Muse writer: update test results (#3845) 2017-08-08 16:43:50 -07:00
Alexander
b50de96502 Muse writer: insert two blanklines between lists of the same type (#3844) 2017-08-08 14:05:49 -07:00
John MacFarlane
a1cd7c3bfd Templates: Have gfm use commonmark template. 2017-08-08 14:05:04 -07:00
John MacFarlane
1ad9679dc9 CommonMark writer: avoid excess blank lines at end of output. 2017-08-08 14:00:13 -07:00
John MacFarlane
3752298d91 Thread options through CommonMark reader.
This is more efficient than doing AST traversals for
emojis and hard breaks.

Also make behavior sensitive to `raw_html` extension.
2017-08-08 13:55:19 -07:00
John MacFarlane
54658b923a Support hard_line_breaks in CommonMark reader. 2017-08-08 13:30:53 -07:00
John MacFarlane
cf54c9b3c2 Document gfm in MANUAL.
Closes #3509.
2017-08-08 13:26:02 -07:00
John MacFarlane
b6f7c4930b CommonMark writer: support hard_line_breaks, smart.
Add tests.
2017-08-08 13:18:27 -07:00
John MacFarlane
ccd4f13a4a Writers.Shared.unsmartify: undo literal double curly quotes.
Previously we left these.
2017-08-08 13:16:45 -07:00
John MacFarlane
714d8a6377 CommonMark reader: support emoji extension. 2017-08-08 12:05:20 -07:00
John MacFarlane
73caf92871 CommonMark reader: support gfm_auto_identifiers.
Added `Ext_gfm_auto_identifiers`: new constructor for `Extension`
in `Text.Pandoc.Extensions` [API change].

Use this in githubExtensions.

Closes #2821.
2017-08-08 11:43:35 -07:00
John MacFarlane
312349bbcc CommonMark writer: Support pipe tables.
We bypass the commonmark writer from cmark and construct our
own pipe tables, with better results.  (Note also that cmark-gfm
currently doesn't support rendering table nodes; see
kivikakk/cmark-gfm-hs#3.)
2017-08-08 11:01:05 -07:00
John MacFarlane
56a680c305 CommonMark writer: support table, strikethrough extensions...
when enabled (as with gfm).  Note: because of limitations in
cmark-gfm, which will hopefully soon be corrected, this currently
gives an error on Tables.

Also properly support `--wrap=none`.
2017-08-08 09:14:13 -07:00
Alexander
c95cc813cc Fix `blanklines' documentation (#3843) 2017-08-08 08:44:18 -07:00
John MacFarlane
d752f85582 CommonMark reader: make exts depend on extensions. 2017-08-07 23:20:29 -07:00
John MacFarlane
91c989d622 Remove GFM modules; use CMarkGFM for both gfm and commonmark.
We no longer have a separate readGFM and writeGFM;
instead, we'll use readCommonMark and writeCommonMark
with githubExtensions.

It remains to implement these extensions conditionally.

Closes #3841.
2017-08-07 23:11:14 -07:00
John MacFarlane
6a9db1fde3 Issue deprecation warning for markdown_github.
Advise to use `gfm` instead.
2017-08-07 22:34:38 -07:00
John MacFarlane
834e9498f9 Logging: Added Deprecated constructor to LogMessage. 2017-08-07 22:34:23 -07:00
John MacFarlane
3bf11cae27 Man writer: removed some unneeded imports. 2017-08-07 22:04:08 -07:00
John MacFarlane
ea6be2e4e7 Added Deprecated warning to LogMessage. 2017-08-07 21:25:07 -07:00
John MacFarlane
5064241b24 Man writer: avoid error for def lists with no definitions.
Closes #3832.
2017-08-07 21:18:50 -07:00
John MacFarlane
2c0e989f9d Markdown reader: fixed spurious parsing as citation as reference def.
We now disallow reference keys starting with `@` if the
`citations` extension is enabled.  Closes #3840.
2017-08-07 21:00:57 -07:00
John MacFarlane
fd23b6dbce Revert "Logging: Made SkippedContent an INFO level message..."
This reverts commit 8995281691.
2017-08-07 17:07:20 -07:00
John MacFarlane
2c81c4c218 Added gfm (GitHub-flavored CommonMark) as an input and output format.
This uses bindings to GitHub's fork of cmark, so it should parse
gfm exactly as GitHub does (excepting certain postprocessing
steps, involving notifications, emojis, etc.).

* Added Text.Pandoc.Readers.GFM (exporting readGFM)
* Added Text.Pandoc.Writers.GFM (exporting writeGFM)
* Added `gfm` as input and output forma

Note that tables are currently always rendered as HTML
in the writer; this can be improved when CMarkGFM supports
tables in output.
2017-08-07 16:59:31 -07:00
John MacFarlane
8995281691 Logging: Made SkippedContent an INFO level message...
rather than WARNING.
2017-08-07 16:53:59 -07:00
John MacFarlane
190f36d2fd Small tweak to previous commit. 2017-08-07 16:11:13 -07:00
John MacFarlane
c806ef1b15 LaTeX reader: Support simple \def macros.
Note that we still don't support macros with fancy parameter
delimiters, like

    \def\foo#1..#2{...}
2017-08-07 16:06:19 -07:00
John MacFarlane
9e6b9cdc5f LaTeX reader: Support \let.
Also, fix regular macros so they're expanded at the
point of use, and NOT also the point of definition.
`\let` macros, by contrast, are expanded at the
point of definition.  Added an `ExpansionPoint`
field to `Macro` to track this difference.
2017-08-07 13:38:15 -07:00
John MacFarlane
3504915e63 LaTeX writer: Don't use figure inside table cell.
Closes #3836.
2017-08-06 22:31:15 -07:00
Alexander
1b5bfced55 Muse reader: debug indented paragraph support (#3839)
Take only first line indentation into account
and do not start new paragraph on indentation change.
2017-08-06 21:43:59 -07:00
Jesse Rosenthal
a67a96b932 Docx reader: Add tests for avoiding zero-level header. 2017-08-06 19:36:25 -07:00
Jesse Rosenthal
a36a56b8ac Docx reader: Avoid 0-level headers.
We used to parse paragraphs styled with "HeadingN" as "nth-level
header." But if a document has a custom style named "Heading0", this
will produce a 0-level header, which shouldn't exist. We only parse
this style if N>0. Otherwise we treat it as a normal style name, and
follow its dependencies, if any.

Closes #3830.
2017-08-06 19:35:03 -07:00
Alexander
8164a005c0 Muse reader: debug list and list item separation rules (#3837) 2017-08-06 13:19:59 -07:00
bucklereed
685788cd4b LaTeX reader: plainbreak, fancybreak et al from the memoir class (#3833) 2017-08-05 10:03:31 -07:00
Alexander Krotov
7a3a8790de Muse reader: do not allow headers in blockquotes (#3831) 2017-08-03 15:41:45 -07:00
Alexander Krotov
38b6adaac0 Muse reader: do not parse blocks inside comments (#3828) 2017-08-03 09:11:00 -07:00
John MacFarlane
ced834076d DokuWiki reader: better handling for code block in list item.
Closes #3824.
2017-08-02 10:33:08 -07:00
John MacFarlane
9932d52b53 Use latest cmark. 2017-08-02 09:20:06 -07:00
John MacFarlane
48bb7abb2a linux/control.in: add Replaces:...
so existing pandoc-citeproc and pandoc-data packages will be
uninstalled; this package provides both.

Closes #3822.
2017-08-02 07:12:14 -07:00
John MacFarlane
b8afec05e0 Markdown writer: better escaping of < and >.
If `all_symbols_escapable` is set, we backslash escape these.
Otherwise we use entities as before.
2017-07-30 13:45:22 -07:00
John MacFarlane
8cbc28415e Class: more haddocks. 2017-07-30 07:43:55 -07:00
John MacFarlane
7f9e950d8d Class: Removed unnecessary withMedia, improved haddocks. 2017-07-30 07:43:55 -07:00
Wandmalfarbe
200b5fb60c Sorted the list of supported HTML5 attributes and removed duplicates. (#3817) 2017-07-26 18:50:10 +02:00