This gets rid of `divAttrToContainers`: an internal convenience function
which had become pretty inconvenient. Rather than converting classes and
indentations to string lists and back, we deal with the `pPr` attribute
directly.
* Added normalizeInlines, normalizeBlocks.
* Type signature is now more narrow, `Pandoc -> Pandoc` instead of
`Data a :: a -> a`. Some users may need to change their uses of
`normalize` to the newly exported `normalizeInlines` or
`normalizeBlocks`.
Here, when hanging indents are greater than or equal to left indents, we
don't set it to block quote. Such indents are frequently used in
academic bibliographies. (Thanks to Caleb McDaniel.)
The new code was got from inspecting changes in MediaWiki.hs
This slightly changes the output of Div blocks, but I'm not
convinced the original behaviour was really correct anyway.
The code for handling Span does nothing for now, until I can
work out the desired behaviour, and add tests for it.
Previously, a fresh state was created for the purpose of updating. In
the future, when there is more than one field in the state, this
obviously won't work.
This is a ReaderT State stack, which keeps track of some environment info, such
as the options and the docx doc. The state will come in handy in the future,
for a couple of planned features (rewriting the section anchors as auto_idents,
and hopefully smart-quoting).
This defines a typeclass `Reducible` which allows us to "reduce" pandoc
Inlines and Blocks, like so
Emph [Strong [Str "foo", Space]] <++> Strong [Emph [Str "bar"]], Str
"baz"] =
[Strong [Emph [Str "foo", Space, Str "bar"], Space, Str "baz"]]
So adjacent formattings and strings are appropriately grouped.
Another set of operators for `(Reducible a) => (Many a)` are also
included.
Images that are bigger than the page were truncated. This will now
scale them if they are larger than the page. The scale is currently
hardcoded with Word "letter" defaults (page size and margins)
The normalizing tests revealed a problem with unformatted spaces, brought about
by `spanTrim`. This fixes by not trimming the spaces out of spans until they
are in their final form.
There were some problems with the old str normalization. This fixes those
problems. Also, since it drills down on its own, it only needs to be
mapped over the blocks, not walked over the tree.
`<span style="font-variant:small-caps;">foo</span>` will be
parsed as a `SmallCaps` inline, and will work in all output
formats that support small caps.
Closes#1360.
When the `hard_line_breaks` option was specified, pandoc would
produce a spurious line break after a tight list item. This
patch solves the problem. Closes#1137.