Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
Docx reader: parsing styles
|
|
Previously a section like this would be enclosed in a paragraph,
with RawInline for the video tags (since video is a tag that can
be either block or inline):
<video controls="controls">
<source src="../videos/test.mp4" type="video/mp4" />
<source src="../videos/test.webm" type="video/webm" />
<p>
The videos can not be played back on your system.<br/>
Try viewing on Youtube (requires Internet connection):
<a href="http://youtu.be/etE5urBps_w">Relative Velocity on
Youtube</a>.
</p>
</video>
This change will cause the video and source tags to be parsed
as RawBlock instead, giving better output.
The general change is this: when we're parsing a "plain" sequence
of inlines, we don't parse anything that COULD be a block-level tag.
|
|
|
|
We no longer need the explicit lists since we're deriving them from the
ground up.
|
|
This is the only one so far. We'll add others as they show up.
|
|
We now no longer check against explicit styles.
|
|
We always favor an explicit positive or negative in a style in a
descendent, and only turn to the ancestor if nothing is set.
We also introduce an (empty) list of styles that are black-listed. We
won't check them. (Think underlines in hyperlinks).
|
|
Two points here: (1) We're going bottom-up, from styles not based on
anything, to avoid circular dependencies or any other sort of
maliciousness/incompetence. And (2) each style points to its
parent. That way, we don't need the whole tree to pass a style over to
Docx.hs
|
|
|
|
|
|
This will make it easier to build the style map from the bottom up (to
avoid any infinite references).
|
|
Just discards info at the moment, so at least it works the same.
|
|
We want to be able to read user-defined styles. Eventually we'll be able
to figure out styles in terms of inheritance as well. The actual
cascading will happen in the docx reader.
|
|
In docx, super- and subscript are attributes of Vertalign. It makes more
sense to follow this, and have different possible values of Vertalign in
runStyle. This is mainly a preparatory step for real style parsing,
since it can distinguish between vertical align being explicitly turned
off and it not being set.
In addition, it makes parsing a bit clearer, and makes sure we don't do
docx-impossible things like being simultaneously super and sub.
|
|
|
|
functions like runElemsToInlines and parPartsToInlines are just defined
in terms of concatting and mapping their singular
version (e.g. `runElemToInlines`). Having two functions with almost
identical names makes it easier to introduce errors. It's easy enough to
just concat and map inline, and it makes it clearer what is going on in
the code.
|
|
Style handling has been cleaned up, but introduced a bug here. There
wasn't previously a test to catch it.
|
|
The big news here is a rewrite of Docx to use the builder
functions. As opposed to previous attempts, we now see a significant
speedup -- times are cut in half (or more) in a few informal tests.
Reducible has also been rewritten. It can doubtless be simplified and
clarified further. We can consider this, at the moment, a reference for
correct behavior.
|
|
This was previously failing to be recognized as a link:
[Test](http://en.wikipedia.org/wiki/Ward's_method)
Closes #1534.
|
|
|
|
|
|
Headers.
We might also want to do this elsewhere (for pars, for example).
|
|
|
|
Otherwise they get left dangling in the document.
|
|
Note that "Italic" can be on, and, from the last commit, `<w:i>` can be
present, but be turned off. In that case, the turned-off tag takes
precedence. So, we have to distinguish between something being off and
something not being there. Hence, isItalic, isBold, isStrike, and
isSmallCaps have become Maybes.
|
|
|
|
Before we just checked for the existence of a tag. Now, we make sure to
check for its on/off value.
|
|
EPUB Reader: Ignores titlepage attribute
|
|
|
|
equation, informalequation, inlineequation and mml:math elements.
|
|
Docx reader: move dropcap combining logic to Reducible
|
|
Indented code at the beginning of a list item must be indented eight
spaces from the margin (or from the edge of the container), or four
spaces past the list marker, whichever is farther.
Some examples in `tests/markdown-reader-more.txt`.
|
|
Introduces a new function in Reducibles, concatR. The idea is that if we
have two list of Reducibles (blocks or inlines), we can combine them and
just perform the reduction on the joining parts (the last element of the
first list, the first element of the second list). This is useful in cases
where the two lists are already reduced, and we're only worried about the
joining elements.
This actually improves the efficiency a bit further, because concatR can be
smart about empty lists.
|
|
Before, we had to run reduceList on the whole combined paragraph, which
was redundant, and could take some time for long paragraphs. We only
need to combine the drop cap with the first inline of the next
paragraph.
|
|
Make sure that adjacent inlines are combined properly in dropcaps. This
updates the test results as well.
|
|
If we get to a dropcap, we keep hold the inlines until the next
paragraph, and combine it there.
|
|
|
|
This should be more efficient.
|
|
Discard empty formatters
|
|
EPUB Normalisation and anchors for div blocks in tex
|
|
Closes #1513.
Lists can now start without an intervening blank line.
Also, html block-level tags that don't start a line are parsed
as RawInline and don't interrupt paragraphs, as in RedCloth.
|
|
|
|
|
|
EPUB improvements
|
|
|
|
|
|
|
|
|
|
Docx reader: Fix spacing issue.
|