John MacFarlane
1db585689a
LaTeX reader: tokenize before pulling tokens,
...
rather than after. This has some performance penalty
but is more reliable.
Closes #4408 .
2018-10-15 15:54:49 -07:00
Albert Krewinkel
7e9e24b8bc
Lua filter docs: describe Attr type
2018-10-15 23:01:23 +02:00
Albert Krewinkel
f6559e5def
Lua filter docs: render field names as code
2018-10-15 22:52:02 +02:00
Albert Krewinkel
d9f179f7f2
Lua filter docs: fix typos
2018-10-15 22:17:12 +02:00
John MacFarlane
788b1bb3d8
LaTeX reader: more care with verbatim mode in macro definitions.
...
This solves some of the issues in #4408 , but it is fragile and may
introduce new problems. We really need to change the approach
fundamentally and expand macros before pulling tokens from the stream,
rather than after.
2018-10-15 12:32:38 -07:00
Albert Krewinkel
aed7aecfc3
Lua filter docs: complete, fix MetaValue documentation
2018-10-15 21:10:05 +02:00
Albert Krewinkel
8a00b30e40
Lua pandoc module: ensure MetaList elements behave like Lists
...
Methods usable on Lists can also be used on MetaList objects.
2018-10-15 21:08:39 +02:00
Albert Krewinkel
a444321be8
Lua pandoc module: fix MetaList constructor
...
Passing a MetaList object to the constructor `pandoc.MetaList` now
returns the passed list as a MetaList. This is consistent with the
constructor behavior when passed an (untagged) list.
Previously, the constructor used to create a new MetaList with the
passed MetaList as its only element.
2018-10-15 21:00:50 +02:00
John MacFarlane
d04ded4ca9
LaTeX reader: more careful placement of withVerbatimMode.
...
for macros
2018-10-15 11:59:05 -07:00
John MacFarlane
6f6ad0514d
LaTeX reader: make macroDef polymorphic and allow in inline context.
...
Otherwise we can't parse something like
```
\lowercase{\def\x{Foo}}
```
I have actually seen tex like this in the wild.
2018-10-15 11:46:31 -07:00
John MacFarlane
e6ee032a6d
LaTeX reader: improved parsing of \def
, \let
.
...
We now correctly parse:
```
\def\bar{hello}
\let\fooi\bar
\def\fooii{\bar}
\fooi +\fooii
\def\bar{goodbye}
\fooi +\fooii
```
2018-10-15 11:27:04 -07:00
John MacFarlane
68ec838014
LaTeX reader: Fix small regression in pattern argumnents...
...
introduced in last commit.
2018-10-15 09:46:15 -07:00
John MacFarlane
41663e9eef
More refactoring of LaTeX reader code.
2018-10-15 00:37:17 -07:00
John MacFarlane
8f5cd946db
T.P.R.LaTeX.Parsing: moved more functions.
2018-10-15 00:37:17 -07:00
John MacFarlane
22f81f78bd
Added failing test case for macros.
2018-10-15 00:37:17 -07:00
John MacFarlane
78ebbc6eef
LaTeX reader: improve parsing of \def
argspec.
2018-10-15 00:37:17 -07:00
John MacFarlane
e752a027f1
T.P.R.LaTeX.Parsing: moved some functions up a level.
2018-10-15 00:37:17 -07:00
Albert Krewinkel
1435d0b079
Lua filters doc: add ReaderOptions to list of objects
2018-10-15 07:56:35 +02:00
Albert Krewinkel
594d36437b
Lua filters: rename ReaderOptions fields, use snake_case
...
Snake case is used in most variable names, using camelCase for these
fields was an oversight. A metatable is added to ensure that the old
field names remain functional.
2018-10-15 07:56:35 +02:00
John MacFarlane
49d0f58f24
LaTeX reader: skip \PackageError
commands.
...
See #4408 . But this doesn't fix the issue.
2018-10-14 17:46:03 -07:00
John MacFarlane
88faa45f1d
Markdown writer: ensure blank between raw block and normal content.
...
Otherwise a raw block can prevent a paragraph from being
recognized as such.
Closes #4629 .
2018-10-14 17:12:06 -07:00
John MacFarlane
ab3e41c822
Use pandoc-citeproc 0.14.7.
2018-10-14 14:49:34 -07:00
John MacFarlane
cf8224045b
Markdown reader: Fix awkward soft break movements before abbreviations.
...
Closes #4635 .
2018-10-14 13:02:36 -07:00
John MacFarlane
2bc429a57c
Travis: give up again on ghc 8.6.1 with cabal.
2018-10-14 12:57:36 -07:00
John MacFarlane
0326d370e9
Travis - another try, without targets.
2018-10-14 12:48:19 -07:00
Albert Krewinkel
6082caf233
Custom writer: provide PANDOC_DOCUMENT instead of Setup function
...
Custom writers have access to the global variable `PANDOC_DOCUMENT`. The
variable contains a userdata wrapper around the full pandoc AST and
exposes two fields, `meta` and `blocks`. The field content is only
marshaled on-demand, performance of scripts not accessing the fields
remains unaffected.
2018-10-14 21:23:41 +02:00
John MacFarlane
983277c6eb
Travis: don't use targets in install deps.
2018-10-14 12:11:17 -07:00
John MacFarlane
c6f9ee64ae
Travis: another try.
2018-10-14 12:05:08 -07:00
John MacFarlane
9b0bd4ec6f
Markdown reader: Added updateStrPos in a couple places where needed.
2018-10-14 10:57:48 -07:00
John MacFarlane
225474879c
Another attempt to make travis work on cabal/ghc 8.6.1.
2018-10-14 10:57:20 -07:00
John MacFarlane
412c162601
Travis: removed quotes.
2018-10-14 10:14:25 -07:00
John MacFarlane
68e6866a01
Another try at ghc 8.6.1/cabal on travis.
2018-10-14 10:05:04 -07:00
John MacFarlane
8f5cd39534
Revert "Travis: add ghc 8.6.1 build."
...
This reverts commit 8cee5b183e
.
2018-10-14 09:54:55 -07:00
John MacFarlane
d534346084
Revert "Tweak travis for ghc 8.6.1."
...
This reverts commit eed4514c4c
.
2018-10-14 09:47:31 -07:00
John MacFarlane
eed4514c4c
Tweak travis for ghc 8.6.1.
2018-10-14 00:01:24 -07:00
Albert Krewinkel
49544069a2
Custom writer: give full access to doc in optional Setup function ( #4967 )
...
Custom writers can specify an optional `Setup` function. The function
takes the full Pandoc document as input and should not return any value.
Users can use this function to configure the writer depending on the
given document's content or its metadata.
data/sample.lua: add sample use of Setup function.
The change allows to control the image format used to encode the image
produced from dot code.
Closes #4957
2018-10-13 23:20:29 -07:00
John MacFarlane
8cee5b183e
Travis: add ghc 8.6.1 build.
2018-10-13 23:13:53 -07:00
John MacFarlane
2018f41193
Update benchmarks for ghc 8.6.1.
2018-10-13 23:13:53 -07:00
John MacFarlane
275594f7f7
Makefile: added full-cabal target.
...
Also, use cabal-new configure in quick-cabal and full-cabal.
2018-10-13 23:13:53 -07:00
John MacFarlane
c86e3d2b6f
Makefile: make trypandoc, benchmarks in quick-cabal target.
2018-10-13 23:13:53 -07:00
Albert Krewinkel
273d4dfcfa
data/sample.lua: replace custom pipe function with pandoc.utils.pipe
2018-10-13 20:54:47 +02:00
John MacFarlane
78871c9b96
Use pandoc-citeproc 0.14.6.
2018-10-13 09:37:45 -07:00
Albert Krewinkel
418f6e093c
Lua filter docs: add documentation for Element/Sec
2018-10-13 16:25:54 +02:00
Albert Krewinkel
d126c26dd5
Lua filter internals: push Shared.Element as userdata
...
Hierarchical Elements were pushed to Lua as plain tables. This is
simple, but has the disadvantage that marshaling is eager: all child
elements will be marshaled as part of the object. Using a Lua userdata
object instead allows lazy access to fields, causing content marshaling
just (but also each time) when a field is accessed. Filters which do not
traverse the full element contents tree become faster as a result.
2018-10-13 14:57:20 +02:00
Albert Krewinkel
3db9e15689
Lua filters: push ListAttributes via constructor
...
This ensures that ListAttributes, as present in OrderedList elements,
have additional accessors (viz. *start*, *style*, and *delimiter*).
2018-10-12 21:13:44 +02:00
Albert Krewinkel
1ac87b487f
Lua filter docs: document list attributes
2018-10-11 22:30:40 +02:00
Albert Krewinkel
5f6f2c69f5
data/pandoc.lua: add datatype ListAttributes
...
Make ListAttributes a datatype. The type is similar to Attr.
2018-10-11 22:28:24 +02:00
Albert Krewinkel
484056a4cd
Lua filter docs: document fields of Citation objects
2018-10-11 21:25:26 +02:00
Albert Krewinkel
2e63e2f2bc
Lua filter docs: document fields of inline objects
2018-10-11 20:51:54 +02:00
John MacFarlane
f5c64c3060
HTML reader: fix htmlTag and isInlineTag to accept processing instructions.
...
Fixes regression #3123 (since 2.0). Added regression test.
2018-10-11 09:58:25 -07:00