Accessing an Attr value (e.g., ` Attr().classes`) was broken; the more
common case of accessing it via an Inline or Block element was
unaffected by this.
If you use a custom syntax definition that refers to a syntax
you haven't loaded, pandoc will now complain when it is highlighting
the text, rather than at the start.
This saves a huge performance hit from the `missingIncludes` check.
Closes#4226.
This attribute was out-of-sync with the actual version as is mostly
irrelevant in the context Lua filters and custom writers. Use the
global `PANDOC_API_VERSION` instead.
*Pandoc*, *Meta*, and *Citation* were just plain functions and did not
set a metatable on the returned value, which made it difficult to amend
objects of these types with new behavior. They are now subtypes of
AstElement, meaning that all their objects can gain new features when a
method is added to the behavior object (e.g., `pandoc.Pandoc.behavior`).
Clearly distinguish between a type and the behavioral properties of an instance
of that type. The behavior of a type (and all its subtypes) can now be amended
by adding methods to that types `behavior` object, without exposing the type
objects internals.
E.g.:
pandoc.Inline.behavior.frob = function () print'42' end
local str = pandoc.Str'hello'
str.frob() -- outputs '42'
Extending all elements of a given type (e.g., all inline elements) was
difficult, as the table used to lookup unknown methods would be reset
every time a new element of that type was created, preventing recursive
property lookup. This is was changed in that all methods and attributes
of supertypes are now available to their subtypes.
This avoids a huge performance sink that comes from evaluating
all the elements of the default syntax map.
Better just to have run-time errors for missing includes?
See #4226.
The fields were named like the Haskell fields, not like the documented,
shorter version. The names are changed to match the documentation and
Citations are given a shared metatable to enable simple extensibility.
Fixes: #4222
This version fixes a bug that made it difficult to handle failures while
getting lists or a Map from Lua. A bug in pandoc, which made it
necessary to always pass a tag when using MetaList or MetaBlock, is
fixed as a result. Using the pandoc module's constructor functions for
these values is now optional (if still recommended).
We had previously defaulted to slideLevel 2. Now we use the correct
behavior of defaulting to the highest level header followed by
content. We change an expected test result to match this behavior.
Previous version replaced *each* element from the template with the
new elements -- leading to multiple overlapping frames. This only
replaces the first instance, and throws out the rest.
Previously (a) the code size wasn't set when we force size, and (b)
the properties was set from the default, instead of inheriting. Both
of those problems were fixed.
A lot of work in the powerpoint writer is replacing XML from within
slidelayouts from templates. This function does a good deal of that
work, and this makes it preserve element order, as well as making it a
bit easier to understand.
This uses the columns/column div format described in the pandoc
manual. At the moment, only two columns (half the screen each) are
allowed. Custom widths are not supported.