Commit graph

12707 commits

Author SHA1 Message Date
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
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
roktas
b4f3eb53f1 Fix debian/changelog.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@494 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-15 22:50:29 +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
4224d91388 Changed website to link to Google's download details page (with
SHA1 checksum) rather than directly to the files.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@491 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-10 22:41:05 +00:00
fiddlosopher
9a2c653277 More website tweaks. Added demo of extra xsl configuration
and CSS in chunked xhtml produced from docbook.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@489 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-10 03:17:37 +00:00
fiddlosopher
3528c72d7e Minor changes to Makefile required by changes to website
build system.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@488 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-10 02:41:27 +00:00
fiddlosopher
e7dabc9dd0 More Changes to website target. Moved to a templating system
for the examples page.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@487 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-10 02:33:33 +00:00
fiddlosopher
8d4a1ed039 More website changes. Include demo of docbook postprocessed
by xmlto.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@486 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-09 20:42:13 +00:00
fiddlosopher
c80f181137 Reorganized Makefile target - now uses a subsidiary Makefile
that can be run from the website directory for small changes.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@485 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-09 18:55:50 +00:00
fiddlosopher
55031090de Need to export TMPDIR in tempdir.sh.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@482 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-09 08:39:19 +00:00
fiddlosopher
f55b54917a On Cygwin, set TMPDIR to . before using mktemp. Otherwise
one gets an error creating the output file in the /tmp directory.
I haven't tracked this one down, but this should serve as a 
workaround.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@481 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-09 08:32:59 +00:00