Commit graph

10123 commits

Author SHA1 Message Date
John MacFarlane
fac3953abf Markdown reader: Don't parse native div as table caption.
Closes #4119.
2017-12-04 15:04:47 -08:00
John MacFarlane
ae60e0196c Add empty_paragraphs extension.
* Deprecate `--strip-empty-paragraphs` option.  Instead we now
  use an `empty_paragraphs` extension that can be enabled on
  the reader or writer.  By default, disabled.

* Add `Ext_empty_paragraphs` constructor to `Extension`.

* Revert "Docx reader: don't strip out empty paragraphs."
  This reverts commit d6c58eb836.

* Implement `empty_paragraphs` extension in docx reader and writer,
  opendocument writer, html reader and writer.

* Add tests for `empty_paragraphs` extension.
2017-12-04 14:56:57 -08:00
John MacFarlane
c58ecde937 MANUAL: note on extensions in gfm. 2017-12-04 10:29:27 -08:00
Alexander Krotov
ed261e5832 Muse reader: add underline support in Emacs Muse mode 2017-12-04 15:59:26 +03:00
John MacFarlane
4235c2d416 Update changelog. 2017-12-03 20:40:52 -08:00
John MacFarlane
c94b970ced Include default CSS for 'underline' class in HTML-based templates. 2017-12-03 20:36:08 -08:00
John MacFarlane
45a46bf900 Removed unnecessary import. 2017-12-03 20:25:04 -08:00
John MacFarlane
03496d1810 Test for #4113.
Closes #4113.
2017-12-03 20:15:40 -08:00
John MacFarlane
d25017fc70 commonmark/gfm writer: use raw html for native divs/spans.
This allows a pandoc markdown native div or span to be
rendered in gfm using raw html tags.
2017-12-03 12:29:57 -08:00
John MacFarlane
5d0863d198 HTML writer: export tagWithAttributes.
This is a helper allowing other writers to create single
HTML tags.
2017-12-03 12:25:23 -08:00
John MacFarlane
0a091f1463 commonmark/gfm writer: implement raw_html and raw_tex extensions.
Note that `raw_html` is enabled by default for `gfm`, while
`raw_tex` is disabled by default.
2017-12-03 11:45:22 -08:00
John MacFarlane
b480d0da7a Bump bounds for binary, http-types, tasty-hunit 2017-12-02 23:24:19 -08:00
John MacFarlane
3ee85960cb Update man page and MANUAL date. 2017-12-02 18:56:45 -08:00
John MacFarlane
c87f39421d Update changelog. 2017-12-02 18:44:58 -08:00
John MacFarlane
92c527713b Docx writer: allow empty paragraphs.
See #2252.

This also changes fixDisplayMath from Text.Pandoc.Writers.Shared
so that it no longer produces empty Para as an artifact.
(That was the original reason the writer omitted them.)
2017-12-02 17:17:39 -08:00
John MacFarlane
d6c58eb836 Docx reader: don't strip out empty paragraphs.
We now have the `--strip-empty-paragraphs` option for that,
if you want it.  Closes #2252.

Updated docx reader tests.

We use stripEmptyParagraphs to avoid changing too
many tests.  We should add new tests for empty paragraphs.
2017-12-02 16:51:31 -08:00
John MacFarlane
f4b86a1bc2 Shared.blocksToInlines: rewrote using builder.
This gives us automatic normalization, so we don't get
for example two consecutive Spaces.
2017-12-02 16:28:20 -08:00
John MacFarlane
7b8c2b6691 Add --strip-empty-paragraphs option.
This works for any input format.
2017-12-02 15:21:59 -08:00
John MacFarlane
e09e6a6ffa Bump to 2.0.4, update changelog. 2017-12-02 11:17:22 -08:00
John MacFarlane
78982d0581 Update tested-with. 2017-12-02 10:56:56 -08:00
John MacFarlane
22eb15ec35 LaTeX writer: escape _ in code with --listings. 2017-12-02 10:31:58 -08:00
John MacFarlane
ecfb5a0838 revealjs template: added a necessary escape. 2017-12-01 22:02:07 -08:00
John MacFarlane
d9f0b816e2 reveal.js template: include tex2jax configuration.
This ensures that we don't use $..$ delimiters, which
gives bad results when $ is used as a currency sign.
This depends on the current dev version of reveal.js.
2017-12-01 21:41:48 -08:00
John MacFarlane
1193c1a505 LaTeX writer: allow specifying just width or height for image size.
Previously both needed to be specified (unless the image was
being resized to be smaller than its original size).

If height but not width is specified, we now set width to
textwidth (and similarly if width but not height is specified).
Since we have keepaspectratio, this yields the desired result.
2017-12-01 21:18:29 -08:00
John MacFarlane
29ec13184d LaTeX writer: escape ~ in code with --listings.
Closes #4111.
2017-12-01 17:17:26 -08:00
John MacFarlane
b2a190546d Revert "LaTeX writer: Add keepaspectratio to includegraphics..."
This reverts commit 171187a452.
2017-12-01 13:51:33 -08:00
Albert Krewinkel
3f1f9536d4
pandoc.lua: set metatable on List MetaValues
The `List` metatable is assigned to the tables which get passed to the
constructors `MetaBlocks`, `MetaInline`, and `MetaList`. This enables
the use of the resulting objects as lists.  This is part of the changes
discussed in #4081.
2017-12-01 18:47:33 +01:00
Albert Krewinkel
6640506ddc
Lua/StackInstances: push Pandoc and Meta via constructor
Pandoc and Meta elements are now pushed by calling the respective
constructor functions of the pandoc Lua module. This makes serialization
consistent with the way blocks and inlines are pushed to lua and allows
to use List methods with the `blocks` value.
2017-12-01 17:58:12 +01:00
Albert Krewinkel
5026dfaedf
lua-filters.md: add documentation for pandoc.List 2017-12-01 17:14:28 +01:00
Albert Krewinkel
8473a151c5
List.lua: add missing fixes as discussed in #4099
The changes were missing due to an error while using git.
2017-12-01 17:12:56 +01:00
John MacFarlane
171187a452 LaTeX writer: Add keepaspectratio to includegraphics...
...if only one of height/width is given.
2017-11-30 16:03:28 -08:00
John MacFarlane
7a8c830734 Use latest tagsoup.
This fixes a bug in parsing tags with `&` following.

Closes #4094.  Closes #4088.
2017-11-30 15:59:06 -08:00
John MacFarlane
03ddac451e Support beamer \alert in LaTeX reader. Closes #4091. 2017-11-29 21:30:13 -08:00
Albert Krewinkel
c65b514ed1
List.lua: add _VERSION to module, drop unused var 2017-11-29 21:13:10 +01:00
John MacFarlane
a276bb0a8a Let papersizes a0, a1, a2, ... be case-insensitive in LaTeX and ConTeXt. 2017-11-29 09:45:38 -08:00
Alexander Krotov
7751391fce Muse reader: correctly remove indentation from notes
Exactly one space is required and considered to be part of the marker.
2017-11-29 05:12:25 +03:00
Albert Krewinkel
0105a3c293 Add basic lua List module (#4099)
The List module is automatically loaded, but not assigned to a global
variable. It can be included in filters by calling `List = require
'List'`.

Lists of blocks, lists of inlines, and lists of classes are now given
`List` as a metatable, making working with them more convenient. E.g.,
it is now possible to concatenate lists of inlines using Lua's
concatenation operator `..` (requires at least one of the operants to
have `List` as a metatable):

    function Emph (emph)
      local s = {pandoc.Space(), pandoc.Str 'emphasized'}
      return pandoc.Span(emph.content .. s)
    end

Closes: #4081
2017-11-28 17:20:01 -07:00
John MacFarlane
5a225aa603 Temporarily disable round-trip block test for muse reader.
See #4107.
2017-11-28 16:13:01 -08:00
John MacFarlane
845b6c8670 Added --print-highlight-style option.
This generates a JSON version of a highlighting style, which can be
saved as a .theme file, modified, and used with `--highlight-style`.

Closes #4106.
Closes #4096.
2017-11-28 13:35:49 -08:00
John MacFarlane
00561b1bb9 Support --webtex for gfm output. 2017-11-28 10:56:32 -08:00
John MacFarlane
8b0b4cd848 Update tests for new skylighting. 2017-11-28 10:49:42 -08:00
Mauro Bieg
393ce6f1e3 make normalizeDate more forgiving (#4101)
also parse two-digit days, e.g. "April 20, 2017"
2017-11-28 11:15:35 -07:00
John MacFarlane
073bcae16c Use skylighting 0.4.4.1.
Closes #4103 (wrong color of unmarked code text when
numerLines is used).
2017-11-27 23:29:19 -08:00
Mauro Bieg
de75d4eaf9 Fix --help output for --highlight-style to include FILE (#4098)
Closes #4095.
2017-11-27 18:30:53 -07:00
John MacFarlane
459b2742cf Travis: Use ghc 8.2.2 instead of 8.2.1. 2017-11-27 16:43:41 -08:00
John MacFarlane
a30612ea1b Travis stack nightly build: switch to ghc 8.2.2. 2017-11-27 16:23:18 -08:00
Alexander Krotov
c2993a6fc6 Muse reader: parse "~~" as non-breaking space in Emacs mode 2017-11-27 12:25:06 +03:00
John MacFarlane
a1378ed76b Clearer deprecation warning for --latexmathml, --asciimathml, -m.
Previously we only mentioned `--latexmathml`, even if `-m` was
used.
2017-11-26 22:31:32 -08:00
Alexander Krotov
00004f042c Muse reader: make code blocks round trip 2017-11-27 04:54:23 +03:00
Alexander Krotov
bdad8c1d69 Muse reader: drop common space prefix from list items 2017-11-26 22:14:18 +03:00