Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
This will allow us to parse instrTxt inside fldChar tags.
|
|
|
|
Different formatting rules across 7.X and 8.X. Use empty case
expression instead.
|
|
If the paragraph has a deleted or inserted paragraph break (depending
on the track-changes setting) we hold onto it until the next
paragraph. This takes care of accept and reject. For this we introduce
a new state which holds the ils from the previous para if necessary.
For `--track-changes=all`, we add an empty span with class
`paragraph-insertion`/`paragraph-deletion` at the end of the paragraph
prior to the break to be inserted or deleted.
Closes #3927.
|
|
We're going to want to use it elsewhere as well, in upcoming tracking
of paragraph insertion/deletion.
|
|
|
|
There isn't any reason to have numberous anchors in the same place,
since we can't maintain docx's non-nesting overlapping. So we reduce
to a single anchor, and have all links pointing to one of the
overlapping anchors point to that one. This changes the behavior from
commit e90c714c7 slightly (use the first anchor instead of the last)
so we change the expected test result.
Note that because this produces a state that has to be set after every
invocation of `parPartToInlines`, we make the main function into a
primed subfunction `parPartToInlines'`, and make `parPartToInlines` a
wrapper around that.
|
|
Docx produces a lot of anchors with nothing pointing to them -- we now
remove these to produce cleaner output. Note that this has to occur at
the end of the process because it has to follow link/anchor rewriting.
Closes #3679.
|
|
|
|
Docx expects that lists will continue where they left off after an
interruption and introduces a new id if a list is starting again. So
we keep track of the state of lists and use them to define a "start"
attribute, if necessary.
Closes #4025
|
|
* Deprecate `--strip-empty-paragraphs` option. Instead we now
use an `empty_paragraphs` extension that can be enabled on
the reader or writer. By default, disabled.
* Add `Ext_empty_paragraphs` constructor to `Extension`.
* Revert "Docx reader: don't strip out empty paragraphs."
This reverts commit d6c58eb836f033a48955796de4d9ffb3b30e297b.
* Implement `empty_paragraphs` extension in docx reader and writer,
opendocument writer, html reader and writer.
* Add tests for `empty_paragraphs` extension.
|
|
We now have the `--strip-empty-paragraphs` option for that,
if you want it. Closes #2252.
Updated docx reader tests.
We use stripEmptyParagraphs to avoid changing too
many tests. We should add new tests for empty paragraphs.
|
|
|
|
|
|
|
|
* Added underlineSpan builder function. This can be easily updated if needed. The purpose is for Readers to transform underlines consistently.
* Docx Reader: Use underlineSpan and update test
* Org Reader: Use underlineSpan and add test
* Textile Reader: Use underlineSpan and add test case
* Txt2Tags Reader: Use underlineSpan and update test
* HTML Reader: Use underlineSpan and add test case
|
|
This gives 20-30% speedup and reduction of memory
usage in most of the writers.
|
|
This follows the suggestions given by the FSF for GPL licensed software.
<https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>
|
|
No longer necessary with pandoc 2.0 framework.
|
|
Replacing trimLineBreaks. This does the work of
normalizeSpaces as well, so we avoid the need for that
function here.
See #1530.
|
|
|
|
|
|
This just parses inside smartTags and yields their contents,
ignoring the attributes of the smartTag. @jkr, you may want
to adjust this, but I wanted to get a fix in as fast as possible
for the dropped content.
Closes #2242; see also #3412.
|
|
There's already a function addWarning in Parsing!
Maybe we can dispense with that now, but I still like
'warning' better as a name.
|
|
* Renaming Text.Pandoc.Class.warn to addWarning avoids conflict
with Text.Pandoc.Shared.warn.
* Removed writeRTFWithEmbeddedImages from Text.Pandoc.Writers.RTF.
This is no longer needed; we automatically handle embedded images
using the PandocM functions. [API change]
|
|
|
|
|
|
|
|
In the past, the docx reader wrote an empty header as an empty list. It
should have the same width as a row (and be filled with empty cells).
(Note that I've reordered the code here slightly to get rid of a call to
`head`. It wasn't unsafe because it tested for null, but it was a bit of
a smell.)
|
|
Tables in MS Word are set by default to have special first-row
formatting, which pandoc uses to determine whether or not they have a
header. This means that one-row tables will, by default, have only a
header -- which we imagine is not what people want. This change
ensures that a one-row table is not understood to be a header only.
Note that this means that it is impossible to produce a header-only
table from docx, even though it is legal pandoc. But we believe that
in nearly all cases, it will be an accidental (and unwelcome) result
Closes #3285.
|
|
We wrap `[CHART]` in a `<span class="chart">`. Note that it maps to
inlines because, in docx, anything in a drawing tag can be part of a
larger paragraph.
|
|
We use the "description" field as alt text and the "title" field as
title. These can be accessed through the "Format Picture" dialog in
Word.
|
|
|
|
The last attempt to make 7.8 happy made 7.10 unhappy. So we need some
conditional logic to appease all versions.
|
|
The GHC 7.8 build was erroring without it.
|
|
|
|
|
|
Previously we only used the first anchor span to affect header ids. This
allows us to use all the anchor spans in a header, whether they're
nested or not.
Along with 62882f97, this closes #3088.
|
|
Previously we always generated an id for headers (since they wouldn't
bring one from Docx). Now we let it use an existing one if
possible. This should allow us to recurs through anchor spans.
|
|
Previously, we would only be able to figure out internal links to a
header in a docx if the anchor span was empty. We change that to read
the inlines out of the first anchor span in a header.
This still leaves another problem: what to do if there are multiple
anchor spans in a header. That will be addressed in a future commit.
|
|
We can't guarantee we'll convert every comment correctly, though we'll
do the best we can. This warns if the comment includes something other
than Para or Plain.
|
|
Previously we had only allowed for warnings in the parser. Now we allow
for them in the `Docx.hs` as well. The warnings are simply concatenated.
|
|
This adds simple track-changes comment parsing to the docx reader. It is
turned on with `--track-changes=all`. All comments are converted to
inlines, which can list some information. In the future a warning will
be added for comments with formatting that seems like it will be
excessively denatured.
Note that comments can extend across blocks. For that reason there are
two spans: `comment-start` and `comment-end`. `comment-start` will
contain the comment. `comment-end` will always be empty. The two will be
associated by a numeric id.
|
|
Previously, readDocx would error out if zip-archive failed. We change
the archive extraction step from `toArchive` to `toArchiveOrFail`, which
returns an Either value.
|
|
The regular readDocx just becomes a special case.
|
|
The feature checklist in the source code was out of date. Update.
|
|
The docx reader used to use a Modifiable typeclass to combine both
Blocks and Inlines. But all the work was in the inlines. So most of the
generality was wasted, at the expense of making the code harder to
understand. This gets rid of the generality, and adds functions for
Blocks and Inlines. It should be a bit easier to work with going forward.
|
|
This avoids performance problems in documents with many identically
named headers.
Closes #2671.
|
|
|