Commit graph

8003 commits

Author SHA1 Message Date
fiddlosopher
956deeda4b Haddock documentation for Text.Pandoc.Blocks.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@638 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-07 22:37:11 +00:00
fiddlosopher
3e6184763e Man writer: Use integral n measures instead of fractional i
measures.  Calculate on basis of a 70 character line, since
the default is 78 but the table will appear indented 8 spaces
in standard man output.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@637 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-07 22:18:46 +00:00
fiddlosopher
6f4017b8ea Put table of contents in its own div (id="toc").
git-svn-id: https://pandoc.googlecode.com/svn/trunk@635 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-07 21:49:46 +00:00
fiddlosopher
54a0e4c3b2 HTML writer modifications:
+ Added code to HTML Writer to generate a table of contents if the
  writerTableOfContents option is specified.  This is an unordered list
  with links to the headers.  It is constructed hierarchically, based on
  the order of the headers and their levels.
+ If a TOC is used, the headers become links back to the TOC.
+ Removed Toc from WriterState; instead, the TOC is generated at the top
  level, by the function tableOfContents.
+ Fixed a bug in uniqueIdentifiers which prevented it from handling more than
  one duplicate.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@634 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-07 19:08:11 +00:00
fiddlosopher
f2b16c2065 + Introduced writerIgnoreNotes option in WriterOptions. This is needed
for processing header blocks for a table of contents, since notes on
  headers should not appear in the TOC.  Set default in Main.hs.
+ Moved Element, headerAtLeast, and hierarchicalize from Docbook writer
  to Text.Pandoc.Shared.  This is because HTML writer now uses these in
  constructing a table of contents.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@633 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-07 19:04:10 +00:00
fiddlosopher
fdf31cd23d Added writerTableOfContents to WriterOptions, and added a
--table-of-contents/--toc command-line option to Main.hs.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@632 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-07 05:43:23 +00:00
fiddlosopher
5a0ce1bcac Changes to HTML writer to incorporate automatic identifiers for
headers and table of contents:
+ WriterState now includes a list of header identifiers and a table
  of contents in addition to notes.
+ The function uniqueIdentifiers creates a list of unique identifiers
  from a list of inline lists (e.g. headers).
+ This list is part of WriterState and gets consumed by blockToHtml
  each time a header is encountered.
+ Headers are now printed with unique identifiers based on their names,
  e.g. Shell_scripts for "# Shell scripts".  Fancy stuff like links,
  italics, etc. gets ignored.  A numerical index is added to the end if
  there is already an identifier by the same name, e.g. "Shell_scripts1".
+ Provision has been made for a table-of-contents block element, but this
  has not yet been added.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@630 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-07 03:52:10 +00:00
fiddlosopher
0a250edfde Minor comment change.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@629 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-07 03:05:06 +00:00
fiddlosopher
ad2c642713 Pandoc.hs: Export all definitions in Text.Pandoc.Definition,
rather than exporting the module.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@628 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-06 16:37:46 +00:00
fiddlosopher
f9c988e703 Fixed bug in Markdown reader: links in footnotes were not
being processed.  Solution:  three-stage parse.  First, get
all the reference keys and add information to state.  Next,
get all the notes and add information to state.  (Reference
keys may be needed at this stage.)  Finally, parse everything
else.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@625 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-06 06:46:31 +00:00
fiddlosopher
1ca8a731bc Added table support to RST writer.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@624 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-05 06:14:48 +00:00
fiddlosopher
09f0247fd8 Added table support to markdown writer.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@623 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-04 22:21:52 +00:00
fiddlosopher
8d776e1e42 Improvements/bug fixes to Text.Pandoc.Blocks
library.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@622 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-04 22:21:08 +00:00
fiddlosopher
1a8b32afd5 Added Text.Pandoc.Blocks module for prettyprinting of
text tables.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@620 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-04 18:53:12 +00:00
fiddlosopher
4fe56a8d18 Man writer:
- Added scheme for specifying manual section and additional
  headers:
  % PROGNAM | 1 | User Manual | Version 4.0
- Modified man page sources to include section 1


git-svn-id: https://pandoc.googlecode.com/svn/trunk@619 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-04 15:53:49 +00:00
fiddlosopher
d5c47c33ca Added table support to man writer (using the tbl preprocessor).
The writer state now includes a list of "preprocessor" codes.
If the document contains a table, "t" (for "tbl") is added to the list.
If this list is nonempty, the man page starts with
.\" <list>
which instructs man to run the file through the appropriate
preprocessor before processing with groff.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@618 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-04 03:14:43 +00:00
fiddlosopher
bd5f3876a4 Man writer: don't change - to \- (minus sign).
Leave them as hyphens.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@614 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-02 02:38:14 +00:00
fiddlosopher
2cb22a1f8a Man writer: better output for line break:
.PD 0     # set interparagraph space to 0
.P        # new paragraph
.PD       # reset interparagraph space to default.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@613 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-02 02:31:36 +00:00
fiddlosopher
f5a3d44494 Minor changes in Man writer:
- escape ' as \[aq], because ' can trigger groff commands.
- remove unneeded line breaks.
- use CR font in code blocks.
- use .P 0 for line breaks.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@612 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-02 02:23:05 +00:00
fiddlosopher
e6f67fcc57 Modified escaping in Man writer. Also changed
format of footnote references and authors list.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@608 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-01 23:23:36 +00:00
fiddlosopher
c726e83ce9 Added groff man writer.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@606 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-06-30 22:42:32 +00:00
fiddlosopher
61024d93ed Require blankspace (but not multiple lines) between URL and
title in links and reference keys.  (Markdown reader.)


git-svn-id: https://pandoc.googlecode.com/svn/trunk@599 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-05-10 22:06:13 +00:00
fiddlosopher
f2c1777598 Fixed bug with indented blocks occurring in definition lists.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@598 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-05-10 22:05:25 +00:00
fiddlosopher
f9731108e8 Improved prettyprinting of definition lists.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@596 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-05-10 18:50:12 +00:00
fiddlosopher
5454c841a9 Added support for definition lists in Docbook writer.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@595 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-05-09 00:47:29 +00:00
fiddlosopher
71cf0a11b3 + Use new alignment parameter in title/author/date,
instead of hardcoded \qc.
+ Adjusted test suite to account for changes in RTF writer.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@594 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-05-09 00:44:56 +00:00
fiddlosopher
c6323b2c78 Changes to RTF writer:
+ Added support for definition lists.
+ Removed extra '\cell' in table output, which caused
  a blank column to the left.
+ Added support for captions in tables.
+ Added an 'alignment' parameter to RTF block writers.
+ Added support for column alignments in tables.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@593 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-05-03 14:46:37 +00:00
fiddlosopher
09fa7e6f63 Added support for definition lists to RST writer.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@592 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-05-03 14:44:28 +00:00
fiddlosopher
292d2bd38d Added support for definition lists to markdown
writer.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@591 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-05-03 14:44:04 +00:00
fiddlosopher
cf081435ff Changed definition list syntax in markdown reader and simplified
the parsing code. A colon is now required before every block in a
definition. This fixes a problem with the old syntax, in which the last
block in the following was ambiguous between a regular paragraph in the
definition and a code block following the definition list:

term
:   definition

    is this code or more definition?



git-svn-id: https://pandoc.googlecode.com/svn/trunk@589 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-05-03 14:42:40 +00:00
fiddlosopher
485fa81559 Resolved issue #10: instead of adding "\n\n" to the
end of strings in Main, do it in readMarkdown and readRST.
(Note: the point of this is to ensure that a block at the
end of the file gets treated as if it has blank space after
it, which is generally what is wanted.)


git-svn-id: https://pandoc.googlecode.com/svn/trunk@588 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-04-22 04:38:05 +00:00
fiddlosopher
726685af1b Fixed bug in anyLine parser. Previously anyLine would parse an
empty string "".  But it should fail on an empty string, or we get an
error from its use inside "many" combinators.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@587 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-04-22 04:19:34 +00:00
fiddlosopher
7742301c09 Support for definition lists in LaTeX writer.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@586 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-04-21 21:38:19 +00:00
fiddlosopher
ffd7248af8 Fixed export declarations; removed unneeded import of
Pandoc.Shared.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@585 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-04-15 16:22:29 +00:00
fiddlosopher
e15fd3bf86 Moved escape and nullBlock parsers from ParserCombinators/Pandoc
to Pandoc/Shared.  Reason:  ParserCombinators/Pandoc is for
general-purpose parsers that don't require Pandoc.Definition.
Also removed some unnecessary imports from Pandoc/Shared.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@584 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-04-15 16:20:07 +00:00
fiddlosopher
944740ce5c Added Table to prettyBlock in Shared.hs.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@582 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-04-13 01:33:10 +00:00
fiddlosopher
92845a9834 Added Text.Pandoc module that exports basic readers, writers,
definitions, and utility functions.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@581 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-04-11 22:57:45 +00:00
fiddlosopher
23df0ed176 Extensive changes stemming from a rethinking of the Pandoc data
structure. Key and Note blocks have been removed. Link and image URLs
are now stored directly in Link and Image inlines, and note blocks
are stored in Note inlines. This requires changes in both parsers
and writers. Markdown and RST parsers need to extract data from key
and note blocks and insert them into the relevant inline elements.
Other parsers can be simplified, since there is no longer any need to
construct separate key and note blocks. Markdown, RST, and HTML writers
need to construct lists of notes; Markdown and RST writers need to
construct lists of link references (when the --reference-links option
is specified); and the RST writer needs to construct a list of image
substitution references. All writers have been rewritten to use the
State monad when state is required.  This rewrite yields a small speed
boost and considerably cleaner code. 

* Text/Pandoc/Definition.hs:
  + blocks:  removed Key and Note
  + inlines:  removed NoteRef, added Note
  + modified Target:  there is no longer a 'Ref' target; all targets
    are explicit URL, title pairs

* Text/Pandoc/Shared.hs:

  + Added 'Reference', 'isNoteBlock', 'isKeyBlock', 'isLineClump',
    used in some of the readers.
  + Removed 'generateReference', 'keyTable', 'replaceReferenceLinks',
    'replaceRefLinksBlockList', along with some auxiliary functions
    used only by them.  These are no longer needed, since
    reference links are resolved in the Markdown and RST readers.
  + Moved 'inTags', 'selfClosingTag', 'inTagsSimple', and 'inTagsIndented'
    to the Docbook writer, since that is now the only module that uses
    them.
  + Changed name of 'escapeSGMLString' to 'escapeStringForXML'
  + Added KeyTable and NoteTable types
  + Removed fields from ParserState;  'stateKeyBlocks', 'stateKeysUsed',
    'stateNoteBlocks', 'stateNoteIdentifiers', 'stateInlineLinks'. 
    Added 'stateKeys' and 'stateNotes'.
  + Added clause for Note to 'prettyBlock'.
  + Added 'writerNotes', 'writerReferenceLinks' fields to WriterOptions.

* Text/Pandoc/Entities.hs: Renamed 'escapeSGMLChar' and
  'escapeSGMLString' to 'escapeCharForXML' and 'escapeStringForXML'

* Text/ParserCombinators/Pandoc.hs: Added lineClump parser: parses a raw
  line block up to and including following blank lines.

* Main.hs:  Replaced --inline-links with --reference-links.

* README: 
  + Documented --reference-links and removed description of --inline-links.
  + Added note that footnotes may occur anywhere in the document, but must
    be at the outer level, not embedded in block elements.
  
* man/man1/pandoc.1, man/man1/html2markdown.1: Removed --inline-links
  option, added --reference-links option

* Markdown and RST readers:
  + Rewrote to fit new Pandoc definition.  Since there are no longer
    Note or Key blocks, all note and key blocks are parsed on a first pass
    through the document.  Once tables of notes and keys have been constructed,
    the remaining parts of the document are reassembled and parsed.
  + Refactored link parsers.

* LaTeX and HTML readers: Rewrote to fit new Pandoc definition. Since
  there are no longer Note or Key blocks, notes and references can be
  parsed in a single pass through the document.

* RST, Markdown, and HTML writers: Rewrote using state monad new Pandoc
  and definition. State is used to hold lists of references footnotes to
  and be printed at the end of the document.

* RTF and LaTeX writers: Rewrote using new Pandoc definition. (Because
  of the different treatment of footnotes, the "notes" parameter is no
  longer needed in the block and inline conversion functions.)

* Docbook writer:
  + Moved the functions 'attributeList', 'inTags', 'selfClosingTag',
    'inTagsSimple', 'inTagsIndented' from Text/Pandoc/Shared, since
    they are now used only by the Docbook writer.
  + Rewrote using new Pandoc definition.  (Because of the different
    treatment of footnotes, the "notes" parameter is no longer needed
    in the block and inline conversion functions.)

* Updated test suite

* Throughout:  old haskell98 module names replaced by hierarchical module
  names, e.g. List by Data.List.

* debian/control: Include libghc6-xhtml-dev instead of libghc6-html-dev
  in "Build-Depends."

* cabalize: 
  + Remove haskell98 from BASE_DEPENDS (since now the new hierarchical
    module names are being used throughout)
  + Added mtl to BASE_DEPENDS (needed for state monad)
  + Removed html from GHC66_DEPENDS (not needed since xhtml is now used)



git-svn-id: https://pandoc.googlecode.com/svn/trunk@580 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-04-10 01:56:50 +00:00
fiddlosopher
74e7497226 Fixed bug in email obfuscation (issue #15). If the text to be obfuscated
contains an entity, this needs to be decoded before obfuscation.
Thanks to thsutton for the patch.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@579 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-04-08 21:04:47 +00:00
fiddlosopher
571c3b4173 Removed Blank block element as unnecessary.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@578 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-17 20:23:47 +00:00
fiddlosopher
9b3d5d88c2 Consolidated 'text', 'special', and 'inline' into 'inline'.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@577 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-17 17:25:28 +00:00
fiddlosopher
cdf7c78b5f Added trys to two list start routines. Reason:
<|> only parses second parser when first hasn't consumed
input.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@576 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-16 06:05:43 +00:00
fiddlosopher
0d2e5eab79 Added clauses for DefinitionList and Table to replaceReferenceLinks in
Text/Pandoc/Shared.hs. This ensures that reference-style links inside
tables and definition lists will be handled properly.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@575 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-12 00:36:41 +00:00
fiddlosopher
d55346ca9a Simplified keyTable, using assumption that key blocks are not
inside other block elements (an assumption that the Markdown
reader uses in making its initial pass anyway).


git-svn-id: https://pandoc.googlecode.com/svn/trunk@574 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-12 00:23:39 +00:00
fiddlosopher
7bf7aba7e7 Changes to Markdown reader relating to definition lists:
+ fixed bug in indentSpaces (which didn't properly handle
  cases with mixed spaces and tabs)
+ rewrote definition list code to conform to new syntax
+ include definition lists in list block
+ failIfStrict on definition lists


git-svn-id: https://pandoc.googlecode.com/svn/trunk@572 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-11 07:56:29 +00:00
fiddlosopher
aca046702e Added support for DefinitionList blocks to HTML writer.
Cleaned up bullet and ordered list code by using
ordList and unordList instead of raw olist and ulist.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@571 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-11 07:54:47 +00:00
fiddlosopher
2e794fdf37 Fixed bug in HTML email obfuscation using --strict mode.
The problem is that the "href" function escapes &, so
(href "&#108;") is 'href="&amp;#108;"'.  Fixed by using
primHtml for the whole link.  Resolves issue 9.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@569 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-11 00:19:15 +00:00
fiddlosopher
115cad8882 Changed syntax of definition lists in Markdown parser:
+ definition blocks must be indented throughout (not
    just in first line)
  + compact lists can be formed by leaving no blank line
    between a definition and the next term


git-svn-id: https://pandoc.googlecode.com/svn/trunk@568 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-10 20:45:19 +00:00
fiddlosopher
5ec31cc727 Added parser for definition lists, derived from reStructuredText
syntax:

term 1
    Definition 1

    Paragraph 2 of definition 1.

term 2
    There must be whitespace between entries.
    Any kind of block may serve as a definition,
    but the first line of each block must be indented.

terms can contain any *inline* elements
    If you want to be lazy, you can just
indent the first line of the definition block.



git-svn-id: https://pandoc.googlecode.com/svn/trunk@566 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-10 17:48:16 +00:00
fiddlosopher
0ce965f34c Modified prettyPandoc to handle DefinitionList elements.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@565 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-10 17:45:00 +00:00
fiddlosopher
68cd976838 Added definition for DefinitionList block element.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@564 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-10 17:44:27 +00:00
fiddlosopher
d5f9b1dbb4 Change in ordered lists in Markdown reader:
+ Lists may begin with lowercase letters only, and only 'a' through
    'n'. Otherwise first initials and page references (e.g., p. 400)
    are too easily parsed as lists.
  + Numbers beginning list items must end with '.' (not ')', which is
    now allowed only after letters).
NOTE:  This change may cause documents to be parsed differently.
Users should take care in upgrading.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@561 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-09 02:37:49 +00:00
fiddlosopher
f1191f029a More smart quote adjustments:
+ remove support for all-caps contractions (too
  much potential for conflict with things like
  'M. Mitterand')
+ add support for 'm as a contraction


git-svn-id: https://pandoc.googlecode.com/svn/trunk@560 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-07 20:53:37 +00:00
fiddlosopher
42ade05ebe Smart quote parsing in Markdown reader:
treat ' followed by ll, re, ve, then a
non-letter, as a contraction.  (e.g.
I've, you're, he'll)


git-svn-id: https://pandoc.googlecode.com/svn/trunk@559 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-07 03:01:43 +00:00
fiddlosopher
402016df28 Fixed bug in noscript part of email obfuscation:
& instead of &amp;


git-svn-id: https://pandoc.googlecode.com/svn/trunk@557 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-04 07:40:22 +00:00
fiddlosopher
21ba6b08f2 Made image parsing in HTML reader sensitive to the
--inline-links option.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@556 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-03 18:25:49 +00:00
fiddlosopher
31c030e3a5 Added --inline-links option to force links in HTML to be parsed
as inline links, rather than reference links.  (Addresses Issue
#4.)


git-svn-id: https://pandoc.googlecode.com/svn/trunk@554 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-03 18:19:31 +00:00
fiddlosopher
463a0e5c3e Changes to test suite for new XHTML output.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@550 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-27 07:05:11 +00:00
fiddlosopher
59065c103f Modified HTML writer to use the Text.XHtml library. This results
in cleaner, faster code, and it makes it easier to use Pandoc in
other projects, like wikis, that use Text.XHtml.  Two functions
are now provided, writeHtml and writeHtmlString:  the former outputs
an Html structure, the latter a rendered string.  The S5 writer is
also changed, in parallel ways (writeS5, writeS5String).  The Html
header is now written programmatically, so it has been removed from
the 'headers' directory.  The S5 header is still needed, but the
doctype and some of the meta declarations have been removed, since
they are written programatically.  The INSTALL file and cabalize
have been updated to reflect the new dependency on the xhtml package.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@549 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-26 19:08:10 +00:00
fiddlosopher
3456355174 Added defaultWriterOptions to Shared.hs.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@545 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-21 01:22:08 +00:00
fiddlosopher
7d3382e9f0 In writing Markdown, print unicode nonbreaking space
(160) as "&nbsp;", since otherwise it is hard to distinguish
from a regular space.  (Addresses Issue #3.)


git-svn-id: https://pandoc.googlecode.com/svn/trunk@541 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-17 04:57:41 +00:00
fiddlosopher
7a04caeea8 Escape non-breaking space in SGML as '&nbsp;' instead of
printing a unicode non-breaking space, which is
hard to distinguish visually from a regular space.
(Resolves issue #3.)


git-svn-id: https://pandoc.googlecode.com/svn/trunk@540 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-17 03:40:28 +00:00
fiddlosopher
1855af4be5 Refactored str and strong in Markdown reader, for clarity.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@539 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-15 02:27:36 +00:00
fiddlosopher
87eb8be143 Got rid of two unneeded 'getState's. Note that
lookAhead automatically saves and restores the state.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@538 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-15 01:43:12 +00:00
fiddlosopher
9ad7c73b57 Use lookAhead instead of getInput/setInput in RST reader.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@537 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-15 01:33:35 +00:00
fiddlosopher
d3efa4aa8a Use lookAhead parser for the "first pass" looking for
reference keys in Markdown parser, instead of parsing
normally, then using setInput to reset input.  Slight
performance improvement. 


git-svn-id: https://pandoc.googlecode.com/svn/trunk@536 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-15 01:22:02 +00:00
fiddlosopher
ae19b94fd1 Removed followedBy' parser from Text/ParserCombinators/Pandoc,
replacing it with the 'lookAhead' parser from
Text/ParserCombinators/Parsec.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@535 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-15 01:10:15 +00:00
fiddlosopher
0114f68d21 Introduced a new map, reverseEntityTable, for lookups
of entity by character, in Entities.hs. This yields a 
small performance improvement.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@534 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-14 18:02:51 +00:00
fiddlosopher
1266b189a1 Changed Entities.hs to use Data.Map rather than
an association list, for a slight performance boost.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@532 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-14 17:39:06 +00:00
fiddlosopher
7f65a4e914 Fixed issue #8: slow performance in parsing inline literals in
RST reader.  The problem was that ``#`` was seen by
'inline' as a potential link or image.  Fix:  insert
'notFollowedBy (char '`')' in link parsers.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@529 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-14 06:57:23 +00:00
fiddlosopher
6e467c26c4 Replaced "choice [(try (string ...), ...]" idiom with
"oneOfStrings" in LaTeX reader.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@528 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-12 17:18:20 +00:00
fiddlosopher
f3437dd27c + Added some needed "try"s before multicharacter parsers,
especially in "option" contexts.
+ Removed the "try" from the "end" parser in "enclosed"
  (Text.Pandoc.Shared).  Now "enclosed" behaves like
  "option", "manyTill", etc.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@527 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-12 17:14:11 +00:00
fiddlosopher
73cbae7202 Added 'try' in front of 'string', where needed, or
used a different parser, in RST reader. This fixes
a bug where ````` would not be correctly parsed as
a verbatim `.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@526 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-12 03:53:14 +00:00
fiddlosopher
ca93680f72 Allow the URI in a RST hyperlink target to start on the line
after the reference key.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@525 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-12 02:46:39 +00:00
fiddlosopher
6c3d96a776 Changed 'encodeEntities' to 'escapeSGMLString'.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@520 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-28 16:40:44 +00:00
fiddlosopher
dc6925542c + Simplified entity handling by removing stringToSGML from Entities.hs.
It is no longer needed now that all entities are processed in the markdown 
  and HTML readers.  All calls to stringToSGML have been replaced by calls
  to encodeEntities.
+ Since inTag's attribute handling already encodes entities, 
  calls to encodeEntities are no longer needed for attribute values, so
  they've been removed.
+ The HTML and Markdown readers now call decodeEntities on all raw
  strings (e.g. authors, dates, link titles), to ensure that no unprocessed
  entities are included in the native representation of the document. 
  (In the HTML reader, most of this work is done by a change in
  extractAttributeName.)
+ The result is a small speed improvement (around 5% on my benchmark)
  and cleaner code.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@519 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-28 00:04:43 +00:00
fiddlosopher
21484713c6 Use encodeEntities rather than stringToSGML for contents of
Str inline in Docbook and HTML writers, since now these
strings should not contain literal entity references.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@518 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-27 22:58:03 +00:00
fiddlosopher
8e0ad5a006 Cleaned up handling of embedded quotes in link titles.
Now these are stored as a '"' character, not as '&quot;'.
The function escapeLinkTitle in the Markdown writer is
unnecessary and was removed.  Tests modified accordingly.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@517 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-27 22:45:14 +00:00
fiddlosopher
141affdb51 More changes in entity handling: Instead of using entities for characters
above 128 in HTML and Docbook output, we now just use unicode.  After all,
we're declaring UTF-8 content in the header.  This makes the HTML and
docbook files produced by pandoc much more readable and editable.

Changes to Entities.hs:
+ Removed specialCharToEntity
+ Added escapeSGMLChar (which just escapes the basic four, <>&")
+ Modified encodeEntities and stringToSGML to use escapeSGMLChar
+ Removed encodeEntitiesNumerical
+ Rewrote encodeEntities for better performance
+ Rewrote stringToSGML for better performance 



git-svn-id: https://pandoc.googlecode.com/svn/trunk@516 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-27 22:13:11 +00:00
fiddlosopher
d06417125d Changes in entity handling:
+ Entities are parsed (and unicode characters returned) in both
  Markdown and HTML readers.
+ Parsers characterEntity, namedEntity, decimalEntity, hexEntity added
  to Entities.hs; these parse a string and return a unicode character.
+ Changed 'entity' parser in HTML reader to use the 'characterEntity'
  parser from Entities.hs.  
+ Added new 'entity' parser to Markdown reader, and added '&' as a 
  special character.  Adjusted test suite accordingly since now we 
  get 'Str "AT",Str "&",Str "T"' instead of 'Str "AT&T"..
+ stringToSGML moved to Entities.hs.  escapeSGML removed as redundant,
  given encodeEntities.
+ stringToSGML, encodeEntities, and specialCharToEntity are given a
  boolean parameter that causes only numerical entities to be used.
  This is used in the docbook writer.  The HTML writer uses named
  entities where possible, but not all docbook-consumers know about
  the named entities without special instructions, so it seems safer
  to use numerical entities there.
+ decodeEntities is rewritten in a way that avoids Text.Regex, using
  the new parsers.
+ charToEntity and charToNumericalEntity added to Entities.hs.
+ Moved specialCharToEntity from Shared.hs to Entities.hs.
+ Removed unneeded 'decodeEntities' from 'str' parser in HTML and
  Markdown readers.
+ Removed sgmlHexEntity, sgmlDecimalEntity, sgmlNamedEntity, and
  sgmlCharacterEntity from Shared.hs.
+ Modified Docbook writer so that it doesn't rely on Text.Regex for
  detecting "mailto" links.



git-svn-id: https://pandoc.googlecode.com/svn/trunk@515 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-27 03:04:40 +00:00
fiddlosopher
f2de08864e Rewrote functions in Text/Pandoc/Shared so as not to use Text.Regex,
which does not support unicode:
  - escapePreservingRegex removed
  - stringToSGML rewritten using Parsec parser
  - new parsers for SGML character entities
  - escapeSGML rewritten using specialCharToEntity
  - new function specialCharToEntity


git-svn-id: https://pandoc.googlecode.com/svn/trunk@514 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-24 23:25:27 +00:00
fiddlosopher
11456ba5ce Changed Markdown autoLink parsing to conform better to
Markdown.pl's behavior.  <google.com> is not treated as
a link, but <http://google.com>, <ftp://google.com>, and
<mailto:google@google.com> are.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@513 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-24 20:55:27 +00:00
fiddlosopher
c94dacec35 Fixed bug in 'extractTagType' in HTML reader: previous
version was not skipping / in close tags.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@512 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-24 20:26:06 +00:00
fiddlosopher
890fbe97ec Refactored markdown reader so that Text.Regex is not used.
Replaced email regex test with a custom email autolink parser
(autoLinkEmail).  Also replaced 'selfClosingTag' with a
custom function 'isSelfClosingTag'.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@511 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-24 19:44:43 +00:00
fiddlosopher
8f0cfe9bd0 Fixed a bug in extractTagType in HTML Reader: the previous
version extracted the attributes, too, which is not wanted.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@510 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-24 19:40:32 +00:00
fiddlosopher
c61f2b6984 Fixed bug in HTML attribute parser: now a space is
required before an attribute.  Previously, <a.b>
would be parsed as an HTML tag with an attribute!


git-svn-id: https://pandoc.googlecode.com/svn/trunk@509 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-24 19:07:35 +00:00
fiddlosopher
ca6cb23f23 Modified Markdown writer to use autolinks when possible.
So, instead of [site.com](site.com) we get <site.com>.
Changed test suite accordingly.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@508 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-24 19:06:30 +00:00
fiddlosopher
0646eef976 Rewrote 'extractTagType' in HTML reader so that it doesn't use
regexs.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@507 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-24 17:43:39 +00:00
fiddlosopher
96919a6ac5 More smart quote bug fixes:
+ LaTeX writer now handles consecutive quotes properly:
  for example, ``\,`hello'\,''
+ LaTeX reader now parses '\,' as empty Str
+ normalizeSpaces function in Shared now removes empty Str elements
+ Modified tests accordingly


git-svn-id: https://pandoc.googlecode.com/svn/trunk@506 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-24 08:14:43 +00:00
fiddlosopher
e6cc2aa3cf Fixed bug in smart quoting: recognize ' in contractions like
"don't" as not beginning single quoted contexts.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@505 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-24 04:49:36 +00:00
fiddlosopher
1121e8738b Removed 'gsub' entirely and replaced its uses with 'substitute'.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@501 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-22 22:52:39 +00:00
fiddlosopher
8f0750574a + Added a 'substitute' function to Shared.hs. This is a generic
list function that can be used to substitute one substring
  for another in a string, like 'gsub' except without regular
  expressions.
+ Use 'substitute' instead of 'gsub' in the LaTeX writer.  This
  avoids what appears to be a bug in Text.Regex, whereby "\\^"
  matches "\350".  There seems to be a slight speed improvement
  as well.  (Note:  If this works, it would be good to replace
  other uses of gsub that don't employ regexs with 'substitute'.) 


git-svn-id: https://pandoc.googlecode.com/svn/trunk@500 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-22 21:28:46 +00:00
fiddlosopher
a7839a18a7 Small bug fix to last change, and count "'S" as well as "'s" as
possessive when followed by non-alphanumeric.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@499 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-18 02:54:07 +00:00
fiddlosopher
2c64e7947b More tweaks to smart quote parsing: a ' is not a single quote
start if followed by 's' and then a non-alphanumeric.  (Yes,
this is English-centric, I'm afraid.  But it does help, and I
can't think of a language in which 's' by itself is a word.)


git-svn-id: https://pandoc.googlecode.com/svn/trunk@498 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-18 02:47:27 +00:00
fiddlosopher
5a48839168 Minor tweaks to smart quoting code.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@497 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-16 23:51:57 +00:00
fiddlosopher
8c257385ac Fixed bug in smart quote recognition: ' before ) or certain
other punctuation must not be an open quote.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@496 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-16 23:46:33 +00:00
fiddlosopher
f3cf1cc168 Fixed haddock documentation errors.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@495 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-16 00:07:42 +00:00
fiddlosopher
60989d0637 Added support for tables in markdown reader and in LaTeX,
DocBook, and HTML writers.  The syntax is documented in
README.  Tests have been added to the test suite.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@493 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-15 19:52:42 +00:00
fiddlosopher
19123a540e Don't use named entities in docbook writer. Instead, use
numerical entities, for portability across stylesheets.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@473 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-09 05:40:40 +00:00
fiddlosopher
d83b70f3a0 + Changed 'escapedChar' in Markdown reader so that only the
characters Markdown escapes are escaped in strict mode.
  When not in strict mode, Pandoc allows all non-alphanumeric 
  characters to be escaped.
+ Added documentation of backslash escapes to README.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@461 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-08 23:54:15 +00:00
fiddlosopher
15ea29b223 Small improvements to indentSpaces. (Allow combinations
of spaces and tabs.)


git-svn-id: https://pandoc.googlecode.com/svn/trunk@446 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-07 01:44:24 +00:00
fiddlosopher
f2c2494b66 Modified HTML output for Image elements, to conform to
Markdown.pl:
+ title attribute comes after alt attribute
+ title is included even if null


git-svn-id: https://pandoc.googlecode.com/svn/trunk@445 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-07 01:06:34 +00:00
fiddlosopher
1bc585837c Fixed performance problems with '--strict' option:
+ Replaced skipEndline with "option ' ' newline" where possible.
+ Replaced "notFollowedBy' header" in definition of endline with
  a faster but equally accurate test for a folliwng header.
+ Removed check at the beginning of 'reference' for
  a noteStart: This is not needed, because note comes before
  referenceKey in the definition of block.
+ Replaced check for a following anyHtmlBlockTag in autoLink
  with a check for anyHtmlTag or anyHtmlEndTag.
+ Other small code cleanups.  


git-svn-id: https://pandoc.googlecode.com/svn/trunk@444 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-07 00:48:46 +00:00
fiddlosopher
233148f963 Fixed bug in Markdown reader's handling of underscores and other
inline formatting markers inside reference labels:  for example,
in '[A_B]: /url/a_b', the material between underscores was being
parsed as emphasized inlines.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@442 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-06 20:47:00 +00:00
fiddlosopher
58dcef0625 Added support for hexadecimal entities: e.g. &#xA0AB;
git-svn-id: https://pandoc.googlecode.com/svn/trunk@441 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-06 19:47:05 +00:00
fiddlosopher
1645fb65e4 Fixed serious performance problems with new Markdown reader:
Instead of using lookahead to determine whether a single quote
is an apostrophe, we now use state.  Inside single quotes,
a ' character won't be recognized as the beginning of a single
quote.  'stateQuoteContext' has been added to keep track of
this. 


git-svn-id: https://pandoc.googlecode.com/svn/trunk@437 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-06 18:41:01 +00:00
fiddlosopher
bb8478e4e2 Merged changes from 'quotes' branch since r431. Smart typography
is now handled in the Markdown and LaTeX readers, rather than in
the writers.  The HTML writer has been rewritten to use the
prettyprinting library.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@436 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-06 09:54:58 +00:00
fiddlosopher
39eb8cbad8 Changed Markdown writer so that it does not use the single-bracket
style of implicit reference link.  It now uses [this style][],
not [this style].  Reason:  only newer, beta versions of Markdown
allow the single-bracket style.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@419 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-05 00:55:38 +00:00
fiddlosopher
a5e3c09fc7 Fixed small bug in consolidateList: added case
for (Str a):Space:Space:rest.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@418 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-04 22:58:28 +00:00
fiddlosopher
030d94e1c3 Refactored SGML escaping functions and "in tag" functions to
Text/Shared/Pandoc.  (escapeSGML, stringToSGML, inTag,
inTagSimple, inTagIndented, selfClosingTag)  These can be
used by both the HTML and Docbook writers.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@417 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-04 22:52:16 +00:00
fiddlosopher
24f3710e09 Fixed bug in encodeEntities (characters less than 128, not 127,
should be encoded).


git-svn-id: https://pandoc.googlecode.com/svn/trunk@416 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-04 17:51:46 +00:00
fiddlosopher
b770a9f009 Removed unneeded 'options' parameter from 'indentedInTags' function
in Docbook writer.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@413 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-04 08:40:22 +00:00
fiddlosopher
99959b68e9 + Improved text wrapping algorithm in markdown, docbook, and RST writers.
LineBreaks no longer cause ugly wrapping in Markdown output.
+ Replaced splitBySpace with the more general, polymorphic function
  splitBy (in Text/Pandoc/Shared).


git-svn-id: https://pandoc.googlecode.com/svn/trunk@411 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-04 01:04:56 +00:00
fiddlosopher
e4880319e6 Modified HTML reader to skip a newline following a <br> tag.
Otherwise the newline will be treated as a space at the beginning
of the next line.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@410 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-03 20:52:12 +00:00
fiddlosopher
d4454536f0 Change 'HtmlEntities' module to 'Entities'. Adjusted calling
code accordingly.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@395 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-02 00:40:12 +00:00
fiddlosopher
4e5745134a Use entities for all characters above 127 in docbook output.
Though XML tools should support unicode, some people will be
using SGML tools, and these do not.  Using entities makes the
docbook files more portable.

Also refactored encodeEntities and charToHtmlEntity in
HtmlEntities.hs


git-svn-id: https://pandoc.googlecode.com/svn/trunk@394 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-02 00:29:22 +00:00
fiddlosopher
2716943855 Changed representation of code blocks to use <screen> and
escaped characters rather than <programlisting> and CDATA.
Reason:  XML source more easily editable and readable.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@393 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-01 22:07:19 +00:00
fiddlosopher
a734aaf2ae Removed a line that was causing a compiler warning in docbook
writer.  The line isn't necessary, since we have a case for
every kind of block element.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@388 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-01 21:11:47 +00:00
fiddlosopher
a9e32505de Merged changes from docbook branch since r363.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@386 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-01 21:08:12 +00:00
fiddlosopher
0d182772f9 Revised inline code parsing in Markdown reader to conform to
Markdown.pl.  Now any number of `'s can begin inline code,
which will end with the same number of `'s.  For example, to
have two backticks as code, write
``` `` ```


git-svn-id: https://pandoc.googlecode.com/svn/trunk@360 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-31 19:22:02 +00:00
fiddlosopher
8b3ac98171 Simplified list parsing code in RST reader.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@356 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-31 18:14:51 +00:00
fiddlosopher
3f5194b3bf Cleaned up some code in RST reader.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@354 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-31 17:34:26 +00:00
fiddlosopher
0b6dc98a0a Changed Markdown reader so that the first pass, in which a list
of reference keys is made, is much faster.  This gets us a big
performance boost.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@353 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-31 17:34:06 +00:00
fiddlosopher
83cddbc682 Removed unneeded 'do' block from 'parseBlocks' definition
in Markdown reader.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@352 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-31 16:46:48 +00:00
fiddlosopher
4ea1b2bdc0 Merged 'strict' branch from r324. This adds a '--strict'
option to pandoc, which forces it to stay as close as possible
to official Markdown syntax.  


git-svn-id: https://pandoc.googlecode.com/svn/trunk@347 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-30 22:51:49 +00:00
fiddlosopher
eea359203a Reversed changes from r246:
+ Removed invisible anchors in front of header tags in HTML output.
  Reason:  no way to prevent duplicate ID attributes (which is invalid
  HTML), since there might be duplicate header titles.  See 
  http://six.pairlist.net/pipermail/markdown-discuss/2005-January/000975.html.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@306 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-29 08:04:39 +00:00
fiddlosopher
d2105f6693 + Added regression tests with footnotes in quote blocks and lists.
+ This uncovered an existing bug in the RTF writer, which got indentation
  wrong on footnotes occuring in indented blocks like lists.  Fixed
  this bug.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@263 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-21 19:33:57 +00:00
fiddlosopher
48b8267126 Fixed a serious bug in the Markdown reader (also affecting LaTeX
and RST readers).  The problem:  these readers ran 'runParser' on
processed chunks of text to handle embedded block lists in lists
and quotation blocks.  But then any changes made to the parser state
in these chunks was lost, as the state is local to the parser.
So, for example, footnotes didn't work in quotes or list items.

The fix:  instead of calling runParser on some raw text, use
setInput to make it the input, then parse it, then use setInput
to restore the input to what it was before.  This is shorter and more
elegant, and it fixes the problem.

'BlockQuoteContext' was also eliminated from ParserContext, as it
isn't used anywhere.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@261 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-21 09:02:06 +00:00
fiddlosopher
862471e417 Fixed two small haddock bugs.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@260 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-21 08:30:08 +00:00
fiddlosopher
11cd6e94e0 Added license text to top of source files.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@258 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-20 20:54:23 +00:00
fiddlosopher
70d291026d Changed 'stability' from 'provisional' to 'alpha'.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@257 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-20 20:20:10 +00:00
fiddlosopher
1fded403c5 Changed 'status' in comment headers from 'unstable' to 'provisional'
(which seems to be the term that is used in this context).


git-svn-id: https://pandoc.googlecode.com/svn/trunk@255 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-20 19:48:46 +00:00
fiddlosopher
b98edf2c74 Made javascript obfuscation of emails even more obfuscatory,
by combining it with entity obfuscation.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@254 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-20 18:16:07 +00:00
fiddlosopher
dc9c6450f3 + Added module data for haddock.
+ Reformatted code consistently.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@252 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-20 06:50:14 +00:00
fiddlosopher
5cf769b1cd Modified the HTML writer to add invisible anchors to each section
heading.  The anchors are derived form the text of the section
heading as described in README.  This makes it easy to insert
links that jump from one part of a document to another:
for example, '[back to the Introduction](#Introduction)'.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@246 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-20 00:25:54 +00:00
fiddlosopher
c1ebe94e40 + Replaced 'comparing' combinator in markdown reader with 'compare'.
'comparing' is from Data.Ord, which is not available in GHC 6.4.
+ Added line break after </li> in HTML footnote output, for easier
  inspection of the source.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@245 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-19 23:46:07 +00:00
fiddlosopher
34bb7a125e Fixed a minor mistake introduced in resolving conflicts from the
merge.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@243 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-19 23:17:53 +00:00
fiddlosopher
661c7e7b1d Merged changes to footnotes branch r219-r240.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@241 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-19 23:13:03 +00:00
fiddlosopher
206c59a386 Removed three files from the repository. These are generated
from templates in src/templates, and so should not be in the
repository.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@234 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-19 21:35:14 +00:00
fiddlosopher
3a6296acae Changed footnote syntax to conform to the de facto standard
for markdown footnotes.  References are now like this[^1]
rather than like this^(1).  There are corresponding changes
in the footnotes themselves.  See the updated README for
more details.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@230 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-19 07:30:36 +00:00
fiddlosopher
a8bbd950e5 Changed '--smartypants' to '--smart' and adjusted documentation
and symbols accordingly.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@224 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-18 22:02:39 +00:00
fiddlosopher
75dbe3248e Removed a / in a comment that was causing haddock to fail.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@213 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-17 18:41:26 +00:00
fiddlosopher
7c319e55ff Modified markdown reader to allow ordered list items to begin
with (single) letters, as well as numbers.  The list item marker
may now be terminated either by '.' or by ')'.  These extensions
to standard markdown are documented in README.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@211 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-16 19:43:00 +00:00
fiddlosopher
19bad8253d Improvements to smart-quote regexs. Now we can better handle
cases where latex commands or HTML entity references appear
after quotes.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@202 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-16 06:14:37 +00:00
fiddlosopher
fe66a90a2a Changed 'putStrLn' to 'putStr' in Main.hs, and modified some
of the readers to make spacing at end of output more consistent.
Modified tests accordingly.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@201 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-16 05:05:02 +00:00
fiddlosopher
6411ea7466 In HTML writer, include <title></title> even if title is null.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@171 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-09 02:05:23 +00:00
fiddlosopher
6536e64128 Minor improvements to LaTeX reader:
+ added nullBlock to preamble parsing, so we can handle unusual
  things like pure TeX
+ modified escapedChar to allow a \ at the end of line to count
  as escaped whitespace
+ treat "thanks" commands as footnotes


git-svn-id: https://pandoc.googlecode.com/svn/trunk@146 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-11-27 06:51:03 +00:00
fiddlosopher
7384774d83 Refactored LaTeX reader for clarity (added isArg function).
git-svn-id: https://pandoc.googlecode.com/svn/trunk@138 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-11-26 07:08:46 +00:00
fiddlosopher
986c1f9dee Pandoc bug fixes:
+ LaTeX reader did not parse metadata correctly.  Now the title,
  author, and date are parsed correctly, and everything else in
  the preamble is skipped.
+ Simplified parsing of LaTeX command arguments and options.  
  The function commandArgs now returns a list of arguments OR
  options (in whatever order they appear).  The brackets are
  included, and a new stripFirstAndLast function is provided
  to strip them off when needed.  This fixes a problem in dealing
  with \newcommand, etc.
+ Added a "try" before "parser" in definition of notFollowedBy'
  combinator.  Adjusted the code using this combinator accordingly.
+ Changed handling of code blocks.  Previously, some readers allowed
  trailing newlines, while others stripped them.  Now, all readers
  strip trailing newlines in code blocks; writers insert a newline
  at the end of code blocks as needed.
+ Changed test suite to reflect these changes. 


git-svn-id: https://pandoc.googlecode.com/svn/trunk@137 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-11-26 07:01:37 +00:00
fiddlosopher
82d7190a0c Fixed two small Haddock comment bugs in Shared.hs.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@87 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-11-08 17:50:09 +00:00
fiddlosopher
3dbd266d21 Improved LaTeX writer's handling of dashes:
+ Recognize a double hyphen as an Em-dash, even when it occurs next
  to punctuation (e.g. a quotation mark).
+ Collapse space around Em-dashes.
+ Process quotes before dashes.  This way (foo -- 'bar') will turn into
  (foo---`bar') instead of (foo---'bar').


git-svn-id: https://pandoc.googlecode.com/svn/trunk@49 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-10-30 23:15:28 +00:00
fiddlosopher
09473903dc Changes to RTF writer:
+ use Helvetica instead of Times New Roman as default font
+ specify \f0 in every \pard; otherwise font sizes are not registered properly
+ modify test of RTF writer accordingly


git-svn-id: https://pandoc.googlecode.com/svn/trunk@32 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-10-29 08:56:26 +00:00
fiddlosopher
df7b682251 initial import
git-svn-id: https://pandoc.googlecode.com/svn/trunk@2 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-10-17 14:22:29 +00:00