Commit graph

330 commits

Author SHA1 Message Date
fiddlosopher
8144c54f82 Improvements to RST reader:
+ Allow field lists to be indented.
+ Parse the contents of field lists instead of treating them as
  raw strings.
+ Represent field lists as definition lists rather than blockquotes.
+ Fixed bug in which metadata would be overridden if the document
  contained more than one field list.
+ Parse fields associated with ..image: blocks, and use the 'alt'
  field, if present, for image alt text and title.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1050 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-10-13 21:39:17 +00:00
fiddlosopher
11e7ad2259 Save and restore position in parseFromString, so that it doesn't
mess up accurate error location reporting.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1049 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-10-13 21:37:06 +00:00
fiddlosopher
403f5f4728 Undid last change: instead of blocking the internal links in the
writers, it makes more sense to block them in the HTML reader.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1048 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-10-12 03:03:29 +00:00
fiddlosopher
4928045915 Man writer: Don't print link source for internal links (#...).
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1047 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-10-11 22:54:01 +00:00
fiddlosopher
ad9603231f Fixed bug in RST reader: previously, code blocks had to be
indented a full tabstop, but RST allows any amount of indentation.
Resolves Issue #27.

+ removed 'variable' parameter from indentedBlock function in
  RST reader, as it is no longer needed
+ updated test suite
+ updated changelog


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1046 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-10-11 05:50:28 +00:00
fiddlosopher
27d3657eef Fixed bug in markdown writer: If an ordered list item began with
a marker greater than 3 characters in width, and the item took more
than one line, it would appear on the line after the list marker,
e.g.:

    (12)
        My list item.
        Multiline.

Now it works as follows:

    (12) My list item.
        Multiline.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1036 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-27 18:52:39 +00:00
fiddlosopher
5b888e8b3b Added a writer option for wrapped text and a command-line option
'--no-wrap', which disables text wrapping.  (Resolves Issue #26.)

+ Added support for '--no-wrap' to Main.hs.
+ Added wrapIfNeeded function to Text.Pandoc.Shared.
+ Use wrapIfNeeded instead of wrapped in the RST, Man, Docbook, and 
  Markdown writers.
+ Note:  Not yet implemented in HTML, LaTeX, or ConTeXt writers. 
  No documentation yet.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1034 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-27 01:23:44 +00:00
fiddlosopher
4f9814087e Fixed a bug in the Markdown writer: incorrect line wrapping in
paragraphs including hard line breaks.  Resolves Issue #25.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1032 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-25 05:43:38 +00:00
fiddlosopher
d9dedf0813 RST writer: If label for a link reference contains a colon,
surround by ` signs so the colon won't be interpreted as the
end of the link label.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1029 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-19 01:15:20 +00:00
fiddlosopher
f8eac5b377 Markdown writer: Don't print title attribute if title is empty.
(This differs from the behavior of Markdown.pl, and agrees with PHP
Markdown.  But John Gruber has indicated that he prefers this behavior.)
Adjusted test suite accordingly.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1026 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-18 01:35:50 +00:00
fiddlosopher
fbb048238e Markdown reader: require space before title in links and references.
This fixes a bug in parsing URLs like http://silly/url(withparen).


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1025 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-18 01:34:36 +00:00
fiddlosopher
65047e354a Remove just one leading and one trailing newline
from contents of <pre>...</pre> in codeBlock parser.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1023 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-17 03:08:14 +00:00
fiddlosopher
6f16d52c11 Changed parsing of code blocks in HTML reader:
+ <code> tag is no longer needed.  <pre> suffices.
+ all HTML tags in the code block (e.g. for syntax highlighting)
  are skipped, because they are not portable to other output formats.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1022 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-17 02:49:28 +00:00
fiddlosopher
d5b7257d7f Simplified HTML attribute parsing (HTML reader).
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1016 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-15 00:44:32 +00:00
fiddlosopher
28c2ee396c Fixed two bugs in HTML reader:
+ <code>...</code> not surrounded by <pre> should count as
  inline HTML, not code block.
+ parser for minimized attributes should not swallow trailing spaces


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1015 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-14 22:40:28 +00:00
fiddlosopher
9cadf53621 + Fixed bug in RST writer's handling of ordered lists. Previously,
list items with multiple lines would not always line up with single-line
  list items.  Now, list items are nested the length of the list marker + 1.
  This looks better and ensures that list items all line up.  (Note that
  list markers are padded to the length of the longest list marker in the
  series.)
+ Use 3-space indent for unordered lists.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1013 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-10 23:44:21 +00:00
fiddlosopher
4b4060b8ef Simplified parsing of reference keys and notes in markdown and RST
readers:
+ The Reference data structure from Text.Pandoc.Shared is no longer
  needed, since
+ referenceKey and noteBlock parses return strings (as many blank lines
  as are occuried by the key or note) and update state themselves.
+ getPosition and setPosition are now used to ensure that error messages
  will give the correct line number.
+ This yields cleaner (and slightly faster) code, with more accurate
  parsing error messages.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1012 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-05 23:55:38 +00:00
fiddlosopher
d5e8ab71a4 HTML writer: Don't produce HTML for table of contents if
there are no headers.  (This would be an empty list, which is
invalid XHTML.)


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1011 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-05 02:16:50 +00:00
fiddlosopher
4f3ad778ba HTML writer: put anchors around contents of headers, not around
the header tags themselves, when producing backlinks to TOC.
Resolves Issue #23.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1000 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-02 17:22:22 +00:00
fiddlosopher
a70c2b261e Markdown writer: escape paragraphs that begin with ordered list
markers, so they don't get interpreted as ordered lists.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@988 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-02 00:39:56 +00:00
fiddlosopher
0982a67585 LaTeX command and environment names can't contain numbers.
LaTeX reader updated accordingly.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@987 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-02 00:36:44 +00:00
fiddlosopher
25bbe134cb Skip notes parsing if running in strict mode. (This yields a nice
speed improvement in strict mode.)


git-svn-id: https://pandoc.googlecode.com/svn/trunk@983 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-01 20:26:40 +00:00
fiddlosopher
76d462c1cd Simplify autolink parsing code, using Network.URI to test for
URIs.  Added dependency on network library to debian/control
and pandoc.cabal.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@982 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-01 17:22:22 +00:00
fiddlosopher
f8f9fa49d6 More perspicuous definition of nonindentSpaces.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@981 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-01 16:08:47 +00:00
fiddlosopher
5c1632be5d Removed unneeded 'try' in 'rawLine'.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@979 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-01 02:26:39 +00:00
fiddlosopher
85d49ee936 Combined linebreak and whitespace into a new whitespace
parser, to avoid unnecessary reparsing of space characters.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@978 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-01 02:18:25 +00:00
fiddlosopher
8d3bec3e4d Removed unnecessary 'try' in 'codeBlock'.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@977 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-01 02:10:30 +00:00
fiddlosopher
bdf78fe33f Use lookAhead in parsers for setext headers and
definition lists to see if the next line begins
appropriately; if not, don't waste any more time
parsing...


git-svn-id: https://pandoc.googlecode.com/svn/trunk@976 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-01 02:01:12 +00:00
fiddlosopher
f55d62c04a Don't require blank lines after code block. (It's sufficient
to end code block with a nonindented line.)


git-svn-id: https://pandoc.googlecode.com/svn/trunk@975 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-31 22:21:41 +00:00
fiddlosopher
c206332558 Changed definition of 'emph': italics with '_' must not be followed
by an alphanumeric character.  This is to help prevent interpretation
of e.g. [LC_TYPE]: my_type as '[LC<em>TYPE]:my</em>type'.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@974 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-31 22:15:35 +00:00
fiddlosopher
89ec99c383 Cleanup up Text.Pandoc.Shared to eliminate warnings
when compiling with -Wall.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@969 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-31 03:32:47 +00:00
fiddlosopher
dcb1dd1ee4 Replaced individual wrapping routines in RST, Man, and
Markdown writers with 'wrapped' from Text.Pandoc.Shared.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@967 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-30 22:59:13 +00:00
fiddlosopher
33d47ced76 Added 'wrapped' function to Text.Pandoc.Shared.
This helps wrap text into paragraphs, using the prettyprinting
library.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@965 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-30 22:49:20 +00:00
fiddlosopher
1827ab40c3 Rewrote LaTeX writer to use the prettyprinting library,
so we get word wrapping, etc.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@964 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-30 22:48:34 +00:00
fiddlosopher
3b790b80f3 Fixed bug in LaTeX reader, which wrongly assumed that the
roman numeral after "enum" in "setcounter" would consist entirely
of "i"s.  enumiv is legitimate.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@961 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-30 19:12:50 +00:00
fiddlosopher
14dc520669 Cleaned up LaTeX reader.
Rearranged order of parsers in inline for slight speed improvement.
Added ` to special characters and 'unescapedChar'.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@960 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-29 21:03:26 +00:00
fiddlosopher
451b426fd6 Removed unneeded try's in RST reader; also minor code cleanup.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@959 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-29 20:39:31 +00:00
fiddlosopher
2a37d8d30a Efficiency improvements to RST reader (more than doubled
speed):
+ removed tabchar
+ rearranged parsers in inline


git-svn-id: https://pandoc.googlecode.com/svn/trunk@958 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-29 20:22:24 +00:00
fiddlosopher
015644b60e Purely stylistic change.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@957 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-29 20:03:28 +00:00
fiddlosopher
7f8ec9577e Removed unneeded 'try' in 'ellipses'.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@956 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-29 19:59:08 +00:00
fiddlosopher
60f700997c + Fixed bug introduced into referenceTitle by previous changes.
Now it works as before.
+ Improved Markdown.pl-compatibility in referenceLink:  the two
  parts of a reference-style link may be separated by one space,
  but not more... [a] [link], [not]   [a link].


git-svn-id: https://pandoc.googlecode.com/svn/trunk@955 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-29 19:57:01 +00:00
fiddlosopher
845a658aff Fixed markdown inline code parsing so it better accords with
Markdown.pl:  the marker for the end of the code section is
a clump of the same number of `'s with which the section began,
followed by a non-` character.  So, for example,

   ` h     ```    i ` -> <code>h     ```    i</code>.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@954 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-29 16:38:41 +00:00
fiddlosopher
77f63605f5 Small change to referenceTitle: should end with line-end, not ')'.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@953 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-29 01:53:50 +00:00
fiddlosopher
21a2acaac9 Split 'title' into 'linkTitle' and 'referenceTitle', since the
rules are slightly different.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@952 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-29 01:51:03 +00:00
fiddlosopher
86cc8c8bf2 Rewrote charsInBalanced and charsInBalanced'.
- Documented restriction: open and close must be distinct characters.
- Rearranged options for greater efficiency.
- Changed inner call to charsInBalanced inside charsInBalanced' to
  charsInBalanced'.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@951 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-29 01:50:36 +00:00
fiddlosopher
64023d8ba8 Removed unneeded 'try' from noteMarker.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@950 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-29 00:16:50 +00:00
fiddlosopher
40b870375d Minor reformatting.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@949 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-29 00:11:37 +00:00
fiddlosopher
3edf5834e8 Rewrote 'para' for greater efficiency.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@948 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-29 00:08:18 +00:00
fiddlosopher
902d6c7115 Fixed bug in LaTeX writer: autolinks would not cause
'\usepackage{url}' to be put in the document header.
Also, changes to state in enumerated list items would be
overwritten.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@947 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-29 00:03:45 +00:00
fiddlosopher
5bafe2c9fb Minor reformatting.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@946 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-28 22:44:01 +00:00