Commit graph

5068 commits

Author SHA1 Message Date
John MacFarlane
1bff443ac9 Removed redundant clause in markdown parser.
Thanks @dubiousjim.  Close #1431.
2014-07-16 07:55:39 -07:00
John MacFarlane
047f9b3714 Merge pull request #1430 from jkr/anchor-fix-2
Fix auto identified headers when already auto-id'ed
2014-07-15 20:27:28 -07:00
Jesse Rosenthal
4b2d07a642 Docx Reader: Fix hdr auto-id when already auto-id.
If header anchors (bookmarks in a header paragraph) already have an
auto-id, which will happen if they're generated by pandoc, we don't want
to rename it twice, and thus end up with an unnecessary number at the
end. So we add a state value to check if we're in a header. If we are,
we don't rename the bookmark -- wait until we rename it in our header
handling.
2014-07-16 03:50:38 +01:00
Jesse Rosenthal
a4671afd64 Docx Reader: Change state handling.
We don't need `updateDState` -- the built-in `modify` works just
fine. And we redefine `withDState` to use modify.
2014-07-16 03:43:14 +01:00
John MacFarlane
897c52880f HTML writer: Removed useless clause. 2014-07-15 16:49:48 -07:00
John MacFarlane
c24ab14918 LaTeX writer: Use \nolinkurl in email autolinks.
This allows them to be styled using `\urlstyle{tt}`.

Thanks to Ulrike Fischer for the solution.
2014-07-15 16:42:39 -07:00
John MacFarlane
73b0630217 EPUB writer: Keep newlines between block elements.
This allows easier diff-ability.  Closes #1424.
2014-07-15 15:41:42 -07:00
John MacFarlane
454d0e4d85 Require highlighting-kate 0.5.8.4.
For correct highlighting of identifiers in prolog and other languages.
2014-07-15 13:31:31 -07:00
John MacFarlane
b80577b395 Shared.fetchItem: unescape URI encoding before reading local file.
Close #1427.
2014-07-15 12:17:45 -07:00
Jesse Rosenthal
643435f1de Docx reader: Add test
Test auto ident header anchors with pandoc-generated pandoc.
2014-07-15 18:32:19 +01:00
John MacFarlane
5883899625 RTF writer: Avoid extra paragraph tags in metadata.
Closes #1421.
2014-07-13 16:40:07 -07:00
John MacFarlane
3e95fd586d Use raw HTML for complex block quotes.
As far as I can see, dokuwiki markup is pretty limited in what
can go in a `>` block quote:  just a single line of paragraph
text.  (#1398)
2014-07-13 16:15:45 -07:00
John MacFarlane
81088281de DokuWiki writer: Use raw HTML for complex lists...
as in the mediawiki writer.  The dokuwiki markup isn't able
to handle multiple block-level items within a list item, except
in a few special cases (e.g. code blocks, and these must be started
on the same line as the preceding paragraph).  So we fall back to
raw HTML for these.

Perhaps there is a better solution.  We can "fake" multiple
paragraphs within list items using hard line breaks (`\\`), but
we must keep everything on one line.

(#1398)
2014-07-13 16:04:29 -07:00
John MacFarlane
0ba2f0b8f9 DokuWiki writer: Normalize to collapse adjacent raw HTML blocks. 2014-07-13 15:48:01 -07:00
John MacFarlane
15956fcac7 DokuWiki writer: Updated tests. 2014-07-13 15:45:59 -07:00
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