Commit graph

237 commits

Author SHA1 Message Date
Francesco Occhipinti
e5845f33ad Don't wrap lines in grid tables when --wrap=none (#4320)
* Annotate gridTable code with comments and abstract small functions
* Don't wrap lines in tables when `--wrap=none`.  Instead, expand cells, even if
   it results in cells that don't respect relative widths or surpass page column width.
* This change affects RST, Markdown, and Haddock writers.
2018-03-17 20:31:43 -07:00
John MacFarlane
b76c0e6a4a RST reader: Allow unicode bullet characters.
Closes #4454.
2018-03-14 17:33:00 -07:00
John MacFarlane
17725a0661 Beamer: put hyperlink after \begin{frame}.
and not in the title.  If it's in the title, then we get
a titlebar on slides with the `plain` attribute, when
the id is non-null.  This fixes a regression from 1.9.x.

Closes #4307.
2018-03-13 10:03:51 -07:00
John MacFarlane
adefd86cd4 LaTeX reader: Fix regression in package options including underscore.
Closes #4424.
2018-03-02 09:33:18 -08:00
John MacFarlane
377640402f LaTeX reader: Fixed comments inside citations. Closes #4374. 2018-02-17 23:06:54 -08:00
Henri Menke
751b5ad010 ConTeXt writer: new section syntax and --section-divs (#4295)
Fixes #2609.

This PR introduces the new-style section headings: `\section[my-header]{My Header}` -> `\section[title={My Header},reference={my-header}]`.

On top of this, the ConTeXt writer now supports the `--section-divs` option to write sections in the fenced style, with `\startsection` and `\stopsection`.
2018-01-25 11:56:28 -08:00
John MacFarlane
ac08a887cf Markdown reader: Fix parsing bug with nested fenced divs.
Closes #4281.

Previously we allowed "nonindent spaces" before the
opening and closing `:::`, but this interfered with
list parsing, so now we require the fences to be
flush with the margin of the containing block.
2018-01-20 14:44:08 -08:00
John MacFarlane
957c0e110d RST reader: fix parsing of headers with trailing space.
This was a regression in pandoc 2.0.

Closes #4280.
2018-01-20 11:10:09 -08:00
John MacFarlane
ca8cd38bdc Markdown reader: don't coalesce adjacent raw LaTeX blocks...
if they are separated by a blank line.

See lierdakil/pandoc-crossref#160 for motivation.
2018-01-17 09:22:35 -08:00
John MacFarlane
615a99c2c2 RST reader: add aligned environment when needed in math.
rst2latex.py uses an align* environment for math in
`.. math::` blocks, so this math may contain line breaks.
If it does, we put the math in an `aligned` environment
to simulate rst2latex.py's behavior.

Closes #4254.
2018-01-14 15:11:11 -08:00
John MacFarlane
d9584d73f9 Markdown reader: Improved inlinesInBalancedBrackets.
The change both improves performance and fixes a
regression whereby normal citations inside inline notes
were not parsed correctly.

Closes jgm/pandoc-citeproc#315.
2018-01-14 12:24:21 -08:00
John MacFarlane
e7d95cadf5 LaTeX reader: pass through macro defs in rawLaTeXBlock...
even if the `latex_macros` extension is set.
This reverts to earlier behavior and is probably safer
on the whole, since some macros only modify things in
included packages, which pandoc's macro expansion can't
modify.

Closes #4246.
2018-01-13 22:12:32 -08:00
John MacFarlane
dca0032b0e LaTeX reader: allow macro definitions inside macros.
Previously we went into an infinite loop with

```
\newcommand{\noop}[1]{#1}
\noop{\newcommand{\foo}[1]{#1}}
\foo{hi}
```

See #4253.
2018-01-13 12:22:25 -08:00
John MacFarlane
49007ded7b RST reader: better handling for headers with an anchor.
Instead of creating a div containing the header, we put
the id directly on the header. This way header promotion
will work properly. Closes #4240.
2018-01-10 12:07:33 -08:00
John MacFarlane
13f7c2cf83 Fixed a test case so it works on windows too. 2018-01-09 17:45:02 -08:00
John MacFarlane
e3f01235e9 HTML writer: Fixed footnote backlinks with --id-prefix.
Closes #4235.
2018-01-09 15:29:27 -08:00
John MacFarlane
3c93ac5cf0 LaTeX reader: be more tolerant of & character.
This allows us to parse unknown tabular environments
as raw LaTeX.  Closes #4208.
2017-12-28 08:41:53 -08:00
John MacFarlane
acfa846aab
Merge pull request #4184 from mb21/html-reader-figcaption
HTML Reader: be more forgiving about figcaption
2017-12-27 13:33:00 -07:00
John MacFarlane
a888083ee1 HTML reader: parse div with class line-block as LineBlock.
See #4162.
2017-12-27 12:26:15 -08:00
John MacFarlane
9e1d86638c LaTeX reader: support \foreignlanguage from babel. 2017-12-26 10:57:57 -08:00
John MacFarlane
ee5fe9bf2c RST reader: allow empty list items (as docutils does).
Closes #4193.
2017-12-24 13:02:18 -08:00
mb21
9b54b94612 HTML Reader: be more forgiving about figcaption
fixes #4183
2017-12-23 09:42:04 +01:00
John MacFarlane
28b736bf95 latex_macros extension changes.
Don't pass through macro definitions themselves when `latex_macros`
is set.  The macros have already been applied.

If `latex_macros` is enabled, then `rawLaTeXBlock` in
Text.Pandoc.Readers.LaTeX will succeed in parsing a macro definition,
and will update pandoc's internal macro map accordingly, but the
empty string will be returned.

Together with earlier changes, this closes #4179.
2017-12-22 18:03:51 -08:00
John MacFarlane
4a07977715 Markdown reader: improved raw tex parsing.
+ Preserve original whitespace between blocks.
+ Recognize `\placeformula` as context.
2017-12-22 18:03:51 -08:00
John MacFarlane
9758720a24 RST writer: fix anchors for headers.
We were missing an `_`.
See #4188.
2017-12-22 10:36:37 -08:00
Alexander Krotov
d035689a06 Org writer: do not wrap "-" to avoid accidental bullet lists
Also add TODO for ordered lists.
2017-12-21 16:36:29 +03:00
Alexander Krotov
1e21cfb251 Muse writer: don't wrap note references to the next line
Closes #4172.
2017-12-19 13:30:48 +03:00
Alexander Krotov
ef8430e702 Fix for #4171 fix: don't wrap note references after SoftBreak 2017-12-19 13:30:48 +03:00
John MacFarlane
c0cc9270cb Org writer: don't allow fn refs to wrap to beginning of line.
Otherwise they can be interpreted as footnote definitions.

Closes #4171.
2017-12-18 16:33:52 -08:00
John MacFarlane
808f6d3fa1 OPML reader: enable raw HTML and other extensions by default for notes.
This fixes a regression in 2.0.

Note that extensions can now be individually disabled, e.g.
`-f opml-smart-raw_html`.

Closes #4164.
2017-12-17 09:52:53 -08:00
John MacFarlane
044d58bb24 Fixed regression in LateX tokenization.
This mainly affects the Markdown reader when parsing
raw LaTeX with escaped spaces.  Closes #4159.
2017-12-15 09:45:29 -08:00
John MacFarlane
b94f1e2045 RST reader: more accurate parsing of references.
Previously we erroneously included the enclosing
backticks in a reference ID (closes #4156).

This change also disables interpretation of
syntax inside references, as in docutils.
So, there is no emphasis in

    `my *link*`_
2017-12-14 12:48:43 -08:00
John MacFarlane
7093a3b44c Markdown: Improved computation of relative cell widths in pipe tables. 2017-12-12 15:36:29 -08:00
John MacFarlane
67b6abc806 LaTeX reader: fix \ before newline.
This should be a nonbreaking space, as long as it's not
followed by a blank line. This has been fixed at the tokenizer
level.

Closes #4134.
2017-12-08 16:34:15 -08:00
John MacFarlane
f6007e7146 Markdown reader: accept processing instructions as raw HTML.
Closes #4125.
2017-12-06 16:05:50 -08:00
John MacFarlane
6a2562efb5 Rewrite empty_paragraphs test so it will run on Windows. 2017-12-04 15:41:09 -08:00
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
03496d1810 Test for #4113.
Closes #4113.
2017-12-03 20:15:40 -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
b2a190546d Revert "LaTeX writer: Add keepaspectratio to includegraphics..."
This reverts commit 171187a452.
2017-12-01 13:51:33 -08: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
03ddac451e Support beamer \alert in LaTeX reader. Closes #4091. 2017-11-29 21:30:13 -08:00
John MacFarlane
508aab0bd5 Text.Pandoc.Parsing.uri: allow & and = as word characters.
This fixes a bug where pandoc would stop parsing a URI with an
empty attribute:  for example, `&a=&b=` wolud stop at `a`.
(The uri parser tries to guess which punctuation characters
are part of the URI and which might be punctuation after it.)

Closes #4068.
2017-11-14 22:08:14 -08:00
John MacFarlane
51897937cd LaTeX reader: allow optional arguments on \footnote.
Closes #4062.
2017-11-13 21:19:38 -08:00
John MacFarlane
8d6e0e516a Markdown writer: fix bug with doubled footnotes in grid tables.
Closes #4061.
2017-11-13 21:12:04 -08:00
John MacFarlane
eeaa3b048c LaTeX reader: support column specs like *{2}{r}.
This is equivalent to `rr`.  We now expand it like a macro.

Closes #4056.
2017-11-12 14:46:29 -08:00
John MacFarlane
7ba0ae8b4d LaTeX reader: allow optional args for parbox.
See #4056.
2017-11-12 14:19:58 -08:00
John MacFarlane
fb5ba1bb00 Fixed YAML metadata with "chomp" (|-).
Previously if a YAML block under `|-` contained
a blank line, pandoc would not parse it as metadata.
2017-11-11 10:17:53 -05:00
John MacFarlane
1592d38821 Allow fenced code blocks to be indented 1-3 spaces.
This brings our handling of them into alignment with
CommonMark's.

Closes #??.
2017-11-09 23:22:44 -05:00