Commit graph

5441 commits

Author SHA1 Message Date
Albert Krewinkel
517f65a7cc
Lua filters: store constructors in registry
Lua functions used to construct AST element values are stored in the Lua
registry for quicker access. Getting a value from the registry is much
faster than getting a global value (partly to idiosyncrasies of hslua);
this change results in a considerable performance boost.
2018-01-23 21:29:58 +01:00
Albert Krewinkel
2e0bb77334
Lua: move getTag from StackInstances to Util
Change: minor
2018-01-23 21:29:52 +01:00
Henri Menke
71bbadb793
ConTeXt writer: xtables: correct wrong usage of caption 2018-01-23 09:15:59 +13:00
Alexander Krotov
e9ed4832ed Muse writer: join code with different attributes during normalization 2018-01-22 16:27:14 +03:00
Alexander Krotov
288065cfd4 Muse writer: indent lists inside Div 2018-01-22 16:24:44 +03:00
John MacFarlane
e9aadc1cfa
Merge pull request #4237 from sitewisely/header_and_footer
Add header and footer parameters for wkhtmltopdf
2018-01-21 11:18:44 -07:00
Alexander Krotov
91bca73266 Muse reader: embed parseBlocks into parseMuse 2018-01-21 03:26:54 +03:00
Alexander Krotov
eaebc5fd19 Muse reader: make listItem generic 2018-01-21 03:26:54 +03: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
Alexander Krotov
1dd5018a80 Muse reader: simplify paragraph parsing
Blanklines are already consumed during block parsing,
there is no need to check for them specifically.
2018-01-21 00:49:43 +03: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
Jesse Rosenthal
fa912bb15e Docx reader: Use already imported operator
This fixes an import error in the last commit.
2018-01-20 09:49:45 -05:00
Jesse Rosenthal
736c2c554f Docx reader: small change to Fields hyperlink parser
Previously, unquoted string required a space at the end of the
line (and consumed it). Now we either take a space (and don't consume
it), or end of input.
2018-01-20 09:40:07 -05:00
John MacFarlane
8ffb4e5b33 Conditional import to avoid warning. 2018-01-19 22:46:29 -08:00
John MacFarlane
b8ffd834cf hlint code improvements. 2018-01-19 21:25:24 -08:00
John MacFarlane
46cd6429d8
Merge pull request #4259 from italia/4248
in RST writer insert comment between lists and quotes, closes #4248
2018-01-19 18:33:07 -07:00
Alexander Krotov
22b69b557e Muse reader: fix parsing of nested definition lists 2018-01-20 02:14:27 +03:00
John MacFarlane
62c395dafa LaTeX reader: fixed parsing of tabular* environment.
This was just a typo in the source.

Closes #4279.
2018-01-19 11:39:27 -08:00
Alexander Krotov
f019d3cc45 Muse reader: remove duplicate variable in definitionListItem 2018-01-19 19:33:11 +03:00
danse
a0ee842096 remove blockToRST' moving its logic into fixBlocks 2018-01-19 16:34:37 +01:00
danse
2165efef7e in RST writer insert comment between lists and quotes, closes #4248 2018-01-19 15:57:54 +01:00
Alexander Krotov
01499b766b Muse writer: support definitions with multiple descriptions
Muse reader does not support this syntax yet, but Emacs Muse parses
it correctly.
2018-01-19 15:00:00 +03:00
Alexander Krotov
7680e9b964 Muse reader: require only one space for nested definition list indentation 2018-01-19 14:16:20 +03:00
Alexander Krotov
4a5801b823 Muse reader: parse verse without parseFromString 2018-01-19 12:12:06 +03:00
Alexander Krotov
4d3f787d63 Muse reader: remove commented out code 2018-01-19 11:36:57 +03:00
Alexander Krotov
9e21ae15e1 Muse reader: parse Emacs Muse directives without parseFromString
Also require space (not newline) after directive name.
2018-01-19 11:29:11 +03:00
Alexander Krotov
fc5d79b6e9 Muse reader: parse link text without parseFromString 2018-01-19 11:14:15 +03:00
Alexander Krotov
c36c02e58d Muse reader: simplify tableParseCaption 2018-01-19 11:12:19 +03:00
Alexander Krotov
19d2576223 Muse reader: parse definition list terms without parseFromString 2018-01-19 01:50:17 +03:00
Alexander Krotov
7e2c75c865 Muse reader: do not remove trailing whitespace from <code> 2018-01-19 01:50:17 +03:00
Jesse Rosenthal
d0a895acee Powerpoint writer: Implement syntax highlighting
This also necessitated implementing colors and underlining, though
there is currently no way to produce these from markdown. Note that
background colors can't be implemented in PowerPoint, so highlighting
styles that require these will be incomplete.
2018-01-18 17:33:05 -05:00
Jesse Rosenthal
63ae907629 Clean up T.P.W.OOXML file, and add copyright. 2018-01-18 11:49:18 -05:00
Jesse Rosenthal
eae7904853 Powerpoint writer: Make our own docProps/core.xml file.
This allows us to set document metadata properties from pandoc metadata.
2018-01-18 10:15:17 -05:00
Jesse Rosenthal
bfef2cbbf3 Powerpoint writer: Add docProps to Presentation datatype.
This picks up the necessary information from meta and carries it over
to the XML output, so Output.hs doesn't need access to the original
pandoc information.
2018-01-18 10:15:12 -05:00
Alexander Krotov
a516198d47 Muse reader: fix parsing of code at the beginning of paragraph 2018-01-18 15:35:43 +03:00
Alexander Krotov
5f57094a47 Muse reader: refactor definition list parsing
Test with wrong indentation is removed,
because now it is parsed as nested lists.
Emacs Muse and Text::Amuse don't have the same
behavior anyway.
2018-01-18 14:55:07 +03:00
Alexander Krotov
9986ccb333 Muse reader: parse "~~" as non-breaking space in Text::Amuse mode
Latest Text::Amuse supports "~~"
2018-01-18 02:46:02 +03:00
Alexander Krotov
ab85143e8a Muse reader: refactor list parsing
Now list item contents is parsed as blocks,
without resorting to parseFromString.

Only the first line of paragraph has to
be indented now, just like in Emacs Muse
and Text::Amuse.

Definition lists are not refactored yet.

See also: issue #3865.
2018-01-18 02:17:26 +03:00
Alexander Krotov
d7f0ecfdd8 Muse reader: code cleanup 2018-01-18 02:17:26 +03:00
Jesse Rosenthal
588af3cc78 Powerpoint writer: Link notes to endnotes slide. 2018-01-17 16:40:32 -05:00
Jesse Rosenthal
42e690d1b2 Powerpoint writer: Use more specific slide id names. 2018-01-17 16:40:32 -05:00
Jesse Rosenthal
0d53efeddb Powerpoint writer: Use slideids to simplify code. 2018-01-17 16:40:32 -05:00
Jesse Rosenthal
63a2507d0e Powerpoint writer: Revamp slide type
This is an internal change to the Presentation type. The algebraic
datatype that used to be called `Slide` is now `Layout`, and Slide is
defined as `Slide SlideId Layout (Maybe Notes)`. Though there should
be no user-visible changes in this commit, it offers two benefits
moving forward:

1. Slides now carry their Id with them, instead of being assigned it
in deck order. This makes it easier to set up a link to, say, an
endnotes slide ahead of time.

2. This makes room for Notes slides, when we implement them.
2018-01-17 16:40:32 -05: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
Jesse Rosenthal
fcbec16e57 Powerpoint writer: Change reference to notesSlide to endNotesSlide
This will prevent confusion when speakers notes are implemented.
2018-01-17 08:32:52 -05:00
Jesse Rosenthal
0482edadbd Powerpoint writer: Move image sizing into picProps.
Rather than passing around attributes, we can have image sizing in the
picProps and then pass it along to write to XML.
2018-01-17 08:32:52 -05:00
Jesse Rosenthal
c1014167b5 ImageSize: add derived Eq instance to Dimension 2018-01-17 08:32:52 -05:00
John MacFarlane
d987a9d114 Markdown writer: fix cell width calculation.
Previously we could get ever-lengthening cell widths
when a table was run repeatedly through `pandoc -f markdown -t
markdown`.  This patch stabilizes the relative cell
widths. Closes #4265.
2018-01-16 23:13:33 -08:00
John MacFarlane
24acb714c1
Merge pull request #4271 from dotlambda/lstinline-ampersand
LaTeX writer: escape & in lstinline
2018-01-16 21:30:22 -07:00
Jesse Rosenthal
95d602d3b7 Docx reader: Parse hyperlinks in instrText tags
This was a form of hyperlink found in older versions of word. The
changes introduced for this, though, create a framework for parsing
further fields in MS Word (see the spec, ECMA-376-1:2016, §17.16.5,
for more on these fields).

Closes #3389 and #4266.
2018-01-16 13:22:02 -05:00