Commit graph

965 commits

Author SHA1 Message Date
John MacFarlane
1d6e1cf9f3 Removed special testHook from Setup.
This was just too fragile and dependent on a changing Cabal API
(see #1526).

Instead of passing the bulid directory to the test program, we
now let the test program find itself (using executable-path)
and then find the pandoc executable relative to itself.
2014-08-13 08:12:07 -07:00
John MacFarlane
7684b24959 Merge pull request #1528 from mpickering/epubtitlepage
EPUB Reader: Ignores titlepage attribute
2014-08-12 16:56:38 -07:00
Matthew Pickering
063ba81622 EPUB Tests: Added wasteland test
This epub contains many epub:type elements including footnotes and
titlepage.
2014-08-13 00:25:18 +01:00
John MacFarlane
81157c7cc6 HTML writer: use 'uri' or 'email' class for autolinks.
This allows them to be styled specially.

Closes #1501.
2014-08-12 15:49:43 -07:00
John MacFarlane
3653018a70 Added mathml tests for docbook reader. 2014-08-12 14:10:52 -07:00
John MacFarlane
f97ec6db2c Markdown reader: Improved parsing of indented code in list items.
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`.
2014-08-12 11:10:48 -07:00
Jesse Rosenthal
45ec035e93 Docx reader: combine inlines properly in dropcaps.
Make sure that adjacent inlines are combined properly in dropcaps. This
updates the test results as well.
2014-08-11 23:31:16 -04:00
Jesse Rosenthal
0808449547 Docx: Add dropcap tests. 2014-08-11 23:10:50 -04:00
John MacFarlane
31811657fa Merge pull request #1521 from jkr/emptyEmph
Discard empty formatters
2014-08-11 14:44:08 -07:00
Jesse Rosenthal
241ef57bb2 Docx reader test: Add an emphasized space to normalize test.
This should be ignored, so the output should be the same as the previous
test.
2014-08-11 15:11:28 -04:00
John MacFarlane
6fae136cbb Textile reader: list and HTML block parsing improvements.
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.
2014-08-11 11:22:39 -07:00
Matthew Pickering
853830d12b Docx Parse: Updated tests 2014-08-11 10:30:32 -04:00
Matthew Pickering
f33ae631f3 Improved EPUB Tests
Rewrote features test to remove all unimplemented features.

There are now all three examples of where an image can be included in
the test.
  1. Cover image
  2. As a spine elemnt
  3. In the document

Tests have also been added to make sure that the mediabag contains all
these images after processing.
2014-08-10 14:58:53 +01:00
John MacFarlane
7ec8dd956f Removed OMath module, depend on texmath >= 0.8. 2014-08-10 06:19:41 -07:00
Matthew Pickering
ecb42cc002 Docx Tests: Updated for reading sym element 2014-08-09 22:37:12 -04:00
Matthew Pickering
5bedaba080 Added test for sym element 2014-08-09 22:37:12 -04:00
Matthew Pickering
d0fbe5b751 Updated EPUB tests 2014-08-09 23:06:16 +01:00
John MacFarlane
bc06ef0edb Merge branch 'newbranch' of https://github.com/mpickering/pandoc into mpickering-newbranch
Conflicts:
	src/Text/Pandoc/Readers/EPUB.hs
2014-08-08 22:22:55 -07:00
John MacFarlane
a4a6b6f28c Plain writer: Use ALL CAPS for level 1 headers. 2014-08-08 15:20:29 -07:00
Matthew Pickering
5b5e53024d Added tests for collapseFilePath 2014-08-08 22:31:02 +01:00
John MacFarlane
f723a0575d Markdown writer: Respect -raw_html.
pandoc -t markdown-raw_html should not emit any raw HTML, even
span and div tags that go with pandoc Span and Div elements.

Cleaned up a bit of the logic with extensions and plain.
2014-08-08 13:34:57 -07:00
John MacFarlane
7b47042ae6 Textile reader: fixed list parsing bug. Closes #1500. 2014-08-08 12:18:47 -07:00
John MacFarlane
10b662c120 EPUB test renaming.
Renamed epub test files so they're identified more clearly as
epub:  features.{epub,native} -> epub.features.{epub,native},
and similarly with formatting.{epub,native}.

Added epub test files to cabal file, so they'll be included in
the tarball.
2014-08-07 22:25:06 -07:00
John MacFarlane
94466c0060 HTML reader: Really ignore DOCTYPE and xml declarations.
This actually does what d71b013841
said it did.

Revised epub tests to remove the repeated DOCTYPE and xml tags.
2014-08-07 22:12:44 -07:00
John MacFarlane
3c4079edc8 Merge pull request #1488 from mpickering/epubfixes
EPUB Reader: Improved image extraction
2014-08-07 19:00:32 -07:00
Matthew Pickering
090b2da267 EPUB tests: Updated test file 2014-08-07 22:56:30 +01:00
Jesse Rosenthal
98d14b2b2a Docx reader: Test inline image code. 2014-08-07 15:34:49 -04:00
John MacFarlane
4630cff2a6 Merge branch 'epubend' of https://github.com/mpickering/pandoc into mpickering-epubend
Conflicts:
	pandoc.cabal
2014-08-04 07:36:18 -07:00
Artyom Kazak
ec88d47f23 Correctly implement capitalisation.
Using `map toUpper` to capitalise text is wrong, as e.g.
“Straße” should be converted to “STRASSE”, which is 1 character
longer. This commit adds a `capitalize` function and replaces
2 identical implementations in different modules (`toCaps` and
`capitalize`) with it.
2014-08-03 17:37:37 +04:00
John MacFarlane
1b9371cfdf Merge branch 'underline-option' of https://github.com/jkr/pandoc 2014-07-31 16:40:20 -07:00
Jesse Rosenthal
43ca784d1c Update docx test to interpret single underline as emph. 2014-07-31 18:46:43 -04:00
Matthew Pickering
0ae2c1f146 EPUB Reader: Added tests 2014-07-31 21:39:50 +01:00
Jesse Rosenthal
96ad37536e Remove now unneeded JSON test file. 2014-07-31 15:47:45 -04:00
Jesse Rosenthal
ed71e9b31d Docx tests: rewrite mediabag tests.
This will allow us to test the whole mediabag (making sure, for example,
that images are added with the correct keys) instead of just individual
extracted images. We compare each entry in the media bag to an image
extracted on the fly from the docx. As a result, we only need one file
to test with.

The image in the current tests was also replaced with a smaller one.
2014-07-31 15:47:45 -04:00
John MacFarlane
6dd2418476 New module, Text.Pandoc.MediaBag.
Moved `MediaBag` definition and functions from Shared:
`lookupMedia`, `mediaDirectory`, `insertMedia`, `extractMediaBag`.
Removed `emptyMediaBag`; use `mempty` instead, since `MediaBag`
is a Monoid.
2014-07-31 12:00:21 -07:00
John MacFarlane
00662faefb Made MediaBag a newtype, and added mime type information to media.
Shared now exports functions for interacting with a MediaBag:

- `emptyMediaBag`
- `lookuMedia`
- `insertMedia`
- `mediaDirectory`
- `extractMediaBag`
2014-07-31 11:05:35 -07:00
Jesse Rosenthal
4d1d8a4b6f Docx test: Test image from media bag. 2014-07-30 22:32:55 -04:00
Jesse Rosenthal
b24b328906 Docx tests: Add test image.
This is the cow image extracted from `docx.image.docx`.
2014-07-30 22:32:27 -04:00
Jesse Rosenthal
16f88edb3b Docx tests: Added media test comparison function.
Also tell pandoc.cabal that we'll be needing base64, since we want to
compare strings here.
2014-07-30 22:31:38 -04:00
John MacFarlane
3e26fb517d Updated RTF writer tests. 2014-07-30 15:30:51 -07:00
Jesse Rosenthal
941df1b0de Docx reader: change tests to make use of media bag. 2014-07-30 12:46:53 -04:00
John MacFarlane
8c2ed54e2e LaTeX writer: use \(..\) instead of $..$ for inline math.
Closes #1464.
2014-07-29 20:45:49 -07:00
John MacFarlane
8d4eebaff4 Merge pull request #1463 from jkr/metadata
Make metadata out of styled pars
2014-07-29 11:15:34 -07:00
Jesse Rosenthal
54708da371 Add and update docx tests in pandoc.cabal. 2014-07-29 13:05:19 -04:00
Jesse Rosenthal
840108a9c1 Docx reader: Make metavalues out of styled paragraphs.
This will make paragraphs styled with `Author`, `Title`, `Subtitle`,
`Date`, and `Abstract` into pandoc metavalues, rather than text. The
implementation only takes those elements from the beginning of the
document (ignoring empty paragraphs).

Multiple paragraphs in the `Author` style will be made into a metaList,
one paragraph per item. Hard linebreaks (shift-return) in the paragraph
will be maintained, and can be used for institution, email, etc.
2014-07-29 13:03:01 -04:00
John MacFarlane
c302ab3133 Markdown writer: More improvements to 'plain' output, updated tests.
Math now appears in unicode if possible, without the distracting
italics around identifiers.

Blank lines around headers are more consistent.

Footnotes appear in regular [n] style.
2014-07-27 07:57:23 -07:00
Matthew Pickering
e340a7da02 Txt2Tags Reader: Added tests 2014-07-27 00:12:57 +01:00
John MacFarlane
18f4490482 Fixed runtime error with compactify'DL on certain lists.
Closes #1452.  Added test.
2014-07-25 10:53:04 -07:00
John MacFarlane
9c3f7688ee DocBook reader: Better handle elements inside code environments.
Of course, we can't include structure in the code block, but
this way we at least preserve the text.  Closes #1449.
2014-07-23 10:06:36 -07:00
John MacFarlane
98c7ada061 HTML reader: parse Div and Span elements even without --parse-raw.
Closes #1434.
2014-07-20 21:43:54 -07:00