Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
Frame can contain other frames with the text boxes.
This is something that has not been considered before
and meant that the whole construction of images was
broken in those cases. Also the captions were fixed/ignored.
|
|
RST requires a space before a footnote marker. We discard those spaces
so that footnotes will be adjacent to the text that comes before
it. This is in line with what rst2latex does. rst2html does not discard
the space, but its html output is different than pandoc's, so this seems
the most semantically correct approach.
Closes #3163
|
|
A `#+CAPTION` attribute before an image is enough to turn an image into a
figure. This wasn't the case because the `parseFromString` function, which
processes the caption value, would fail on empty values. Adding a newline
character to the caption value fixes this.
Fixes: #3161
|
|
[ODT Parser] Include list's starting value
|
|
Review revealed that we didn't handle the case
when the starting point is an empty string. While
this is not a valid .odt file, we simply added
a special case to deal with it.
Also added tests for the new feature.
|
|
We do basically the same thing every time we insert notes, so let's cut
down on code duplication.
|
|
Previously we required 0.5.
Remove CPP conditionals for earlier versions.
|
|
This reverts commit 3f82471355286d33f2d73329c29a51c47bf76ad7.
We might want to revert the requirement of http-client 0.5,
as this is not yet in Stackage and that is starting to
cause problems. I can't recall why it is there.
|
|
Line blocks are allowed to contain empty lines and should be parsed as a
single block in that case. Previously an empty (line block) line would
have terminated parsing of the line block element.
|
|
Markup-features focusing on lines as distinctive part of the markup are read
into `LineBlock` elements. This currently means line blocks in reStructuredText
and Markdown (the latter only if the `line_block` extension is enabled), the
`linegroup`/`line` combination from the Docbook 5.1 working draft, and Org-mode
`VERSE` blocks.
|
|
The following markup features are used to output the lines of the `LineBlock`
element:
- AsciiDoc: a `[verse]` block,
- ConTeXt: text surrounded by `\startlines` and `\endlines`,
- HTML: `div` with an per-element style setting to interpret the content as
pre-wrapped,
- Markdown: line blocks if the `line_blocks` extension is enabled, a simple
paragraph with hard linebreaks otherwise,
- Org: VERSE block,
- RST: a line block, and
- all other formats: a paragraph, containing hard linebreaks between lines.
Custom lua writers should be updated to use the `LineBlock` element.
|
|
The `linesToBlock` function takes a list of lines and combines them by appending
a hard `LineBreak` to each line and concatenating the result, putting the result
it into a `Para`. This is most useful when dealing when converting `LineBlock`
elements.
|
|
Previously the starting value of the lists' items has been
hardcoded to 1. In reality ODT's list style definition can
provide a new starting value in one of its attributes.
Writers already handle the modified start value so no need
to change anything in that area.
|
|
Highly influenced by the docx support, refactored
some code to avoid DRY.
|
|
Specify location for footnotes (and reference links) in MD output
|
|
This allows footnotes and refs to be placed at the end of blocks and
sections. Note that we only place them at the end of blocks that are at
the top level and before headers that are the top level. We add an
environment variable to keep track of this. Because we clear the
footnotes and refs when we use them, we also add a state variable to
keep track of the starting number.
Finally, note that we still add any remaining footnotes at the end. This
takes care of the final section, if we are placing at the end of a
section, and will always come after a final block as well.
|
|
This will make it easier to keep track of what level of block we are at.
|
|
This will be used by the markdown writer for deciding where to put links
and footnotes.
|
|
An empty verse line should not result in `Str ""` but in `mempty`.
|
|
Previously we'd emit raw HTML tables even if the `raw_html`
extension was disabled.
Now we just emit `[TABLE]` if no table formats are enabled
and raw HTML is not enabled.
We also check for the `raw_html` extension before emiting
a raw HTML block.
Closes #3154.
|
|
|
|
PrintWidth is set at the beginning and stays the same throughout the
document writing, so we just set it as an env variable in the Reader
monad.
|
|
More meaningful variable name, and explanatory comment.
|
|
Now RTL is turned and off by a general function, `withDirection`
wrapping `inlineToOpenXML` and `blockToOpenXML`. This acts according to
the `envRTL` variable. This means we can just set the environment at the
outset, and change the environment with `local` as need be.
Note that this requires making the `inlineToOpenXML` and
`blockToOpenXML` functions into wrappers around
primed-versions (`{inline,block}ToOpenXML`) where the real work takes
place.
|
|
In general, we want things that are either:
1. unchanging environment variables, or
2. environment variables that will change for a the scope of
a function and then pop back
to be in the reader monad. This is safer for (1), since we won't
accidentally change it, and easier for (2), since we can use `local`
instad of setting the old value and then resetting.
We keep the StateT monad for values that we will want to accumulate or
change and then use later.
|
|
A few commented out functions were left in the code during the
conversion from StateT to ReaderT. This removes them.
|
|
We had to use this because we set the env, which means that setRTL
wouldn't do anything at the top level. We now don't set the env (it will
always be false at the outset), which means the toplevel setRTL will
work if necessary.
|
|
We only filter on the name, not the prefix.
|
|
At the toplevel we don't check to see if RTL is already set.
|
|
|
|
|
|
Things that get pushed and then reset are better in ReaderT, because
they can be run with `local`.
|
|
This will allow us to add text and paragraph properties depending on if
rtl is already set or not.
(It would probably be cleaner and safer to move the paraprops and
textprops to this part of the stack in the future.)
|
|
`foo bar.jpg` becomes `foo_bar.jpg`. This was already done
for internal links, but it also needs to happen for images.
Closes #3052.
|
|
This means that underscores won't be used for emphasis,
or CAPS for bold. The metadata fields will just have unadorned
text.
Closes #3066.
|
|
In AsciiDoc, you must use a special form of emphasis (double `__`)
for intraword emphasis. Pandoc was previously using this more
than necessary.
Closes #3068.
|
|
jgm/doctemplates.
This allows the pandoc templating system to be used independently.
|
|
See #168.
Text.Pandoc.Options.Extension has a new constructor `Ext_brackted_spans`,
which is enabled by default in pandoc's Markdown.
|
|
LaTeX: Do not set [htbp] figure placement options.
|
|
Backticks in verbatim environments are converted to
open-single-quotes. This change makes them appear as backticks. This
corresponds to how we treat `'' in verbatim environments (with
\textquotesingle{}).
|
|
We don't want ligatures like ` ?` ` (which produces `¿`) inside
`\texttt{}` environments, so we enclose the backtick in braces.
This fixes #3121
|
|
TEI doesn't have `<book>` elements but only generic `<divN>` division elements.
Checking the template for a trailing `</book>` is nonsensical.
|
|
Add --parts command line argument.
This only effects LaTeX writer, and only for non-beamer output formats.
It changes the output levels so the top level is 'part', the next
'chapter' and then into sections.
|
|
This closes #3102. Note that DocBook does not have a class attribute,
but at least this provides an anchor for internal links.
|
|
Our lower bound on http-client is 0.5, and both of these min_version
tests are less than 0.5, so they will always pass.
|
|
This tests for a min value >= 0.5. But we have a lower bound of 0.5 in
pandoc.cabal, so the test will always pass.
(If we bump the lower bound to 0.5.1, we can remove a conditional in the
HTML writer as well.)
|
|
Because time 1.4 is a boot library for GHC 7.8, we will support the
compatibility module as long as we support 7.8. But we should be clear
about when we will no longer need it.
|
|
We already lower-bound tagsoup at 0.13.7, which means we were always
running the compatibility layer (it was conditional on min value
0.13). Better to just use `lookupEntity` from the library directly, and
convert a string to a char if need be.
|
|
Base 4.4 is ghc 7.2, so we don't have to worry about getting a lower version.
|