Commit graph

11370 commits

Author SHA1 Message Date
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 &


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
f99cedd236 Strip executable binaries before installing.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@551 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-27 07:16:20 +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
e0303dfc79 'cp -a' does not work in BSD. Replace with 'cp -R'.
Note that we don't want user and group to be preserved,
anyway.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@547 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-23 17:31:46 +00:00
fiddlosopher
e9d66b8ed8 Modified changelog: note on defaultWriterOptions.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@546 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-21 01:23:11 +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
90390b65f4 Modified changelog to incorporate changes since the 0.3 release.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@544 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-20 01:21:42 +00:00
fiddlosopher
06ff1feea0 Use 'highlight' to produce syntax-highlighted versions of
xml, html, and tex demo pages (in website /examples/).
Add links so that html files can be viewed as web pages
(without syntax highlighting).


git-svn-id: https://pandoc.googlecode.com/svn/trunk@543 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-19 04:47:12 +00:00
fiddlosopher
8138fc48ae Change extensions of example text files in website demo to
'.text' -- the only reason for this is that I use '.txt' for
page source files, and generally exclude them from being uploaded
to the website.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@542 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-19 02:03:40 +00:00
fiddlosopher
7d3382e9f0 In writing Markdown, print unicode nonbreaking space
(160) as " ", 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 ' ' 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
5a9b7c229d Added freebsd directory, with freebsd port, to repository.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@531 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-14 17:09:17 +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
df03ca2c95 Added link to FreeBSD port in website.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@524 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-11 19:20:03 +00:00
fiddlosopher
f7fcbf528f Use "gaps" in copyrightMessage string for cleaner code formatting.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@521 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-31 01:08:57 +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 '"'.
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