Commit graph

5103 commits

Author SHA1 Message Date
John MacFarlane
71da4f8c55 DokuWiki writer: More tweaks to email links. (#1398) 2014-07-13 15:45:45 -07:00
John MacFarlane
80467d1b18 DokuWiki writer: Use pointy brackets for email links.
(#1398)
2014-07-13 15:36:14 -07:00
John MacFarlane
fbf7cbfdc8 Dokuwiki writer: More idiomatic code for escaping. 2014-07-13 15:32:16 -07:00
John MacFarlane
798c57d9b2 DokuWiki writer: More raw HTML fixes. (#1398)
* Use uppercase HTML tags for block-level content, lowercase for
  inline.
* Newline before closing HTML tag.
2014-07-13 15:28:47 -07:00
John MacFarlane
ce0960ba5a DokuWiki writer: Fix raw inlines and blocks.
* mediawiki > dokuwiki
* ignore raw content other than html or dokuwiki.

(#1398)
2014-07-13 15:25:25 -07:00
John MacFarlane
92bcd8d298 Markdown writer: Use span with style for SmallCaps. (#1360) 2014-07-13 15:21:50 -07:00
John MacFarlane
9d10df7ff4 Clarified documentation on small caps. (#1360) 2014-07-13 15:21:32 -07:00
John MacFarlane
f6b81b2905 Markdown writer: use Span instead of (hackish) SmallCaps in plainify. 2014-07-13 15:14:35 -07:00
John MacFarlane
a7daf29eaf EPUB writer: Use stringify instead of custom plainify.
As far as I can tell, it does about the same thing.
2014-07-13 15:10:44 -07:00
John MacFarlane
ea1bb4ed27 Better comment on removeFormatting. 2014-07-13 15:10:27 -07:00
John MacFarlane
5dba2e2192 Shared: Generalized type of removeFormatting. 2014-07-13 14:56:20 -07:00
John MacFarlane
5df812f7eb Merge branch 'claremacrae-dokuwiki'.
Use removeFormatting from Shared instead of the custom unfancy
function.
2014-07-13 14:44:53 -07:00
John MacFarlane
172a184274 Shared: Added removeFormatting.
API change (addition of exported function).
2014-07-13 10:13:22 -07:00
John MacFarlane
cb62cd08e0 Use renderTags' for all tag rendering.
This properly handles tags that should be self-closing.
Previously `<hr/>` would appear in EPUB output as `<hr></hr>`.
Closes #1420.
2014-07-13 08:28:28 -07:00
John MacFarlane
3516d9d09b Fixed typo in module header for Asciify.
Thanks to @dubiousjim. Closes #1419.
2014-07-12 23:47:38 -07:00
John MacFarlane
47a5f04761 Parsing: Simplified dash and ellipsis.
This originated with @dubiousjim's observation in #1419
that there was a typo in the definition of enDash.
It returned an em dash character instead of an en dash.

I thought about why this had not been noticed before, and
realized that en dashes were just being parsed as regular
symbols.

That made me realize that, now that we no longer have
dedicate EnDash, EmDash, and Ellipses inline elements, as
we used to in pandoc, we no longer need to parse the
unicode characters specially.  This allowed a considerable
simplification of the code.

Partially resolves #1419.
2014-07-12 23:44:56 -07:00
John MacFarlane
4676bfdf82 Removed space at ends of lines in source. 2014-07-12 22:57:22 -07:00
John MacFarlane
8bbcff0cfc Merge pull request #1414 from mpickering/general
Improvements to Parsing.hs
2014-07-12 14:11:09 -07:00
John MacFarlane
6c4345aa0b Merge pull request #1415 from jkr/nicertype
Nicer Docx type
2014-07-12 14:06:29 -07:00
John MacFarlane
0756616241 Merge pull request #1418 from wcaleb/document_code_attr_ext
document fenced_code_attributes extension
2014-07-12 14:04:30 -07:00
Caleb McDaniel
a9f00ee0d6 document fenced_code_attributes extension
Adds explanation of this extension to the README, using
description provided in 7654db9df1.
2014-07-12 15:48:54 -05:00
Jesse Rosenthal
fe2eda9d54 Docx Reader: Add a compatibility layer for Except.
mtl switched from ErrorT to ExceptT, but we're not sure which mtl we'll
be dealing with. This should make errors work with both.

The main difference (beside the name of the module and the monad
transformer) is that Except doesn't require an instance of an Error
Typeclass. So we define that for compatability. When we switch to a
later mtl, using Control.Monad.Exception, we can just erase the instance
declaration, and all should work fine.
2014-07-12 18:04:06 +01:00
Jesse Rosenthal
d65fd58171 Docx Reader: A nicer Docx type.
This modifies the Docx type in the parser to avoid all the extra files
(Notes, numbering, etc). A reader monad keeps track of these, and applies
them at the end. The reader monad is stacked with ErrorT to enable better
error-handling than the old Maybes. (Note that the better error handling
isn't really there yet, but it is now possible.)

One long-term goal of these changes is to make it easier to write the Docx
type. This should make it easier to develop a standalone docx package in the
future.
2014-07-12 18:03:27 +01:00
John MacFarlane
7654db9df1 Markdown writer: don't use braced attributes for fenced code.
Removed `Ext_fenced_code_attributes` from `markdown_github`
extensions.

If this extension is not set, the first class attribute will
be printed after the opening fence as a bare word.

Closes #1416.
2014-07-11 15:54:21 -07:00
Matthew Pickering
72fe742ca0 Removed inline fmap from Parsing.hs
Replaced all inline occurences of fmap with the more idiomatic (<$>).
2014-07-11 12:53:31 +01:00
Matthew Pickering
2fb8063f78 Removed (>>~) function
This function is equivalent to the more general (<*) which is defined in
Control.Applicative. This change makes pandoc code easier to understand for
those not familar with the codebase.
2014-07-11 12:51:26 +01:00
Matthew Pickering
f201bdcb58 Generalised all functions in Parsing.hs
Before it wasn't possible to use these general combinators with the ParsecT
transformer but with the more general types this is now possible.
2014-07-11 12:45:34 +01:00
John MacFarlane
05a5b4e3c2 HTML writer: Deactivate "incremental" inside slide speaker notes.
Closes #1394.
2014-07-10 15:05:24 -07:00
John MacFarlane
9e0495cb83 Fixed an issue caused by e4263d306e.
This sets `stateInHtmlBlock` to `Just "div"` when we're parsing
an HTML div.

Without this fix, a closing `</div>` tag could be parsed as part
of a list item rather than after the list.
2014-07-10 15:04:18 -07:00
John MacFarlane
83d4c2733c Markdown reader: Fixed regression with intraword underscores.
Closes #1121.
2014-07-10 14:51:08 -07:00
John MacFarlane
ee522be94f Markdown reader: Slight rewrite of enclosure/emphOrStrong code.
Semantics should be the same.
2014-07-10 14:37:10 -07:00
John MacFarlane
ff86702a95 Added failing test for issue #1121. 2014-07-10 14:23:20 -07:00
John MacFarlane
ca159de30a Documented fact that you can put YAML metadata in a separate file.
See #1412.
2014-07-10 13:49:40 -07:00
John MacFarlane
66378062b6 LaTeX writer: Put table captions above tables.
The standard seems to be captions above tables.  (See
http://tex.stackexchange.com/questions/3243/why-should-a-table-caption-be-placed-above-the-table)
2014-07-10 13:06:41 -07:00
Clare Macrae
c7431283d6 DokuWiki writer: Remove broken formatting from headings (#1398) 2014-07-08 22:05:04 +01:00
Clare Macrae
5769f178e1 Put myself as maintainer (#1398) 2014-07-08 21:18:31 +01:00
John MacFarlane
7d6da118d3 Added type attribute to link tags in epub3 template.
They are supposed to be only "advisory" in HTML5, but apparently
kindlegen needs them.
2014-07-08 00:24:17 -06:00
John MacFarlane
d1ac594d4a Added test for issue #1330. 2014-07-07 22:27:28 -06:00
John MacFarlane
f96a2b91f5 Reorganized some markdown tests. 2014-07-07 22:21:04 -06:00
John MacFarlane
3d2f2ec0c6 Updated dokuwiki tests for latest changes to testsuite.native. 2014-07-07 16:25:41 -06:00
John MacFarlane
7560f99167 Document DokuWiki writer in README. 2014-07-07 16:20:28 -06:00
John MacFarlane
7d9136edbb Minor line wrapping. 2014-07-07 16:20:18 -06:00
John MacFarlane
616cf6c539 Merge branch 'dokuwiki' of https://github.com/claremacrae/pandoc into claremacrae-dokuwiki 2014-07-07 16:15:35 -06:00
John MacFarlane
e4263d306e Revamped raw HTML block parsing in markdown.
- We no longer include trailing spaces and newlines in the
  raw blocks.
- We look for closing tags for elements (but without backtracking).
- Each block-level tag is its own RawBlock; we no longer try to
  consolidate them (though `--normalize` will do so).

Closes #1330.
2014-07-07 15:53:59 -06:00
John MacFarlane
91b902f02f EPUB writer: better handle HTML media tags. 2014-07-07 15:53:59 -06:00
John MacFarlane
3d4e76f342 Parsing: Added stateInHtmlBlock to ParserState.
This is used to keep track of the ending tag we're waiting
for when we're parsing inside HTML block tags.
2014-07-07 15:53:59 -06:00
John MacFarlane
8c7abf173a normalize: consolidate adjacent RawBlocks when possible. 2014-07-07 15:53:59 -06:00
John MacFarlane
cbeb931554 HTML reader: adjust blockTags and eitherBlockOrInline.
- Added `audio` and `source` in `eitherBlockOrInline`.
- Moved `video`, `svg`, `progress`, `script`, `noscript`, `svg` from
  `blockTags` to `eitherBlockOrInline`.
- `map` and `object` were mistakenly in both lists; they have been removed
  from `blockTags`.
2014-07-07 15:53:59 -06:00
John MacFarlane
186b8e71e0 Merge pull request #1397 from jkr/equations
Docx Reader: Parse Docx OMML math/equations
2014-07-07 11:13:03 -06:00
John MacFarlane
5ea21760d9 MediaWiki writer: Minor renaming of 'st' prefixed names. 2014-07-04 18:56:11 -06:00