Commit graph

2180 commits

Author SHA1 Message Date
John MacFarlane
c08ca6fa6d HTML reader: Simplified parsing of <script> sections.
I had previously assumed that we needed to ignore
</script> occuring in a string literal or javascript
comment.  It turns out, though, that browsers aren't
that smart.
2010-12-22 19:20:27 -08:00
John MacFarlane
4bfe140ed1 Made --smart work with HTML reader.
It did not work before, because - and quotes were gobbled
up by the str parser.
2010-12-22 17:05:17 -08:00
John MacFarlane
63bf227e04 RST reader: Added unicode quote characters to specialChars.
(So they can trigger Quoted environments.)
2010-12-22 17:04:56 -08:00
John MacFarlane
bbad129066 RST reader: recouped speed loss due to addition of --smart.
This was achieved by rearranging the parsers in inline.

Benchmarks went from 500ms to 307ms -- not quite back to the
279ms we had in 1.6, before supporting smart punctuation and
footnotes, but close.
2010-12-22 15:10:21 -08:00
John MacFarlane
4ba3afbb4d ODT writer: Don't wrap text in opendocument. 2010-12-22 14:55:59 -08:00
John MacFarlane
137dc85239 Added stats.sh, to make it easier to collect benchmark & loc info. 2010-12-22 14:13:47 -08:00
John MacFarlane
dc597a8a68 Removed all dependencies on 'pretty' package. 2010-12-22 11:48:08 -08:00
John MacFarlane
8e9c490b0a Texinfo writer: Updated to use Pretty. 2010-12-22 11:43:43 -08:00
John MacFarlane
f15d479fc2 Shared: Removed unneeded prettyprinting functions:
wrapped, wrapIfNeeded, wrappedTeX, wrapTeXIfNeeded, hang'.
2010-12-22 00:34:36 -08:00
John MacFarlane
21d2d918ac Shared: Removed BlockWrapper, wrappedBlocksToDoc.
These are no longer needed with the new Pretty module.
2010-12-22 00:28:20 -08:00
John MacFarlane
369502bbb4 Pretty: Added quote, doubleQuote. 2010-12-22 00:22:28 -08:00
John MacFarlane
fd07db16e9 Man writer: updated to use Pretty. 2010-12-22 00:22:13 -08:00
John MacFarlane
c904024944 OpenDocument writer: Updated to use Pretty. 2010-12-21 16:59:17 -08:00
John MacFarlane
e2548a1317 XML: don't use breaking spaces in attribute lists. 2010-12-21 16:46:21 -08:00
John MacFarlane
ebdbb06f94 Docbook writer: Updated to use Pretty. 2010-12-21 16:45:43 -08:00
John MacFarlane
ce533ffd90 Pretty: don't print a breaking space before a newline. 2010-12-21 16:45:13 -08:00
John MacFarlane
fe1152985c Shared: Made splitBy take a test instead of an element. 2010-12-21 08:41:24 -08:00
John MacFarlane
4e446358d1 XML: Replaced escapeStringAsXML with a faster version.
Benchmarked with criterion, it's about 8x faster than
the old version.  This speeds up docbook, opendocument,
and html writers.
2010-12-21 08:23:48 -08:00
John MacFarlane
6aa0a187b3 Added link to repo of CSL styles to README. 2010-12-20 19:41:31 -08:00
John MacFarlane
78cea94f45 Markdown writer: use \ for newline instead of two spaces at eol.
(Unless --strict.)
2010-12-20 19:36:40 -08:00
John MacFarlane
8889ae8b5b Markdown writer: Use delimited code block if there are attributes.
(Unless in strict mode.)
2010-12-20 19:36:40 -08:00
John MacFarlane
0086329c36 Plain writer: set stateStrictMarkdown automatically. 2010-12-20 19:36:40 -08:00
John MacFarlane
2587543457 ConTeXt writer: Updated to use Text.Pandoc.Pretty. 2010-12-20 19:36:35 -08:00
John MacFarlane
112717de4e Renamed 'enclosed' to 'inside'.
This avoids conflict with 'enclosed' in Text.Pandoc.Parsing.
2010-12-20 19:09:01 -08:00
John MacFarlane
2fe271d163 Pretty: Fixed parens. 2010-12-19 17:20:18 -08:00
John MacFarlane
71bc3789a3 Fixed markdown-citations.ieee.txt. 2010-12-19 12:43:25 -08:00
John MacFarlane
9fd45aaa2d Fixed markdown-citations.txt. 2010-12-19 12:42:32 -08:00
John MacFarlane
9210b7ef69 Fixed biblatex/natbib citation writer tests. 2010-12-19 12:41:27 -08:00
John MacFarlane
9120514998 Pretty: Added enclosed, parens. 2010-12-19 12:39:49 -08:00
John MacFarlane
59cc27c10b LaTeX writer: A bit of code polish. 2010-12-19 10:21:16 -08:00
John MacFarlane
99a58e51f5 LaTeX writer: Modified to use Pretty.
Improved footnote formatting, removed spurious blank lines.
2010-12-19 10:14:12 -08:00
John MacFarlane
09aec9f3e3 Shared: Use stringify to simplify inlineListToIdentifier. 2010-12-19 10:13:36 -08:00
John MacFarlane
6aa5010617 Pretty: Added braces and brackets. 2010-12-19 10:13:11 -08:00
John MacFarlane
89bf312765 LaTeX writer: Use \paragraph, \subparagraph for level 4,5 headers. 2010-12-18 15:05:21 -08:00
John MacFarlane
543aa28c38 Added new prettyprinting module.
* Added Text.Pandoc.Pretty.
  This is better suited for pandoc than the 'pretty' package.
  One advantage is that we now get proper wrapping; Emph [Inline]
  is no longer treated as a big unwrappable unit. Previously
  we only got breaks for spaces at the "outer level." We can also
  more easily avoid doubled blank lines.  Performance is
  significantly better as well.

* Removed Text.Pandoc.Blocks.
  Text.Pandoc.Pretty allows you to define blocks and concatenate
  them.

* Modified markdown, RST, org readers to use Text.Pandoc.Pretty
  instead of Text.PrettyPrint.HughesPJ.

* Text.Pandoc.Shared:  Added writerColumns to WriterOptions.

* Markdown, RST, Org writers now break text at writerColumns.

* Added --columns command-line option, which sets stColumns
  and writerColumns.

* Table parsing:  If the size of the header > stColumns,
  use the header size as 100% for purposes of calculating
  relative widths of columns.
2010-12-17 13:39:17 -08:00
John MacFarlane
2a075e9d7a test-pandoc: removed need to depend on MissingH. 2010-12-15 18:07:36 -08:00
John MacFarlane
605648cbbf Added 'tests' Cabal flag.
+ This ensures that test-pandoc gets built.
+ 'cabal test' now runs this.
+ The old tests/RunTests.hs has been removed, and
  src/test-pandoc.hs added.
2010-12-15 17:54:51 -08:00
John MacFarlane
63cf37a9ca HTML reader: allow : in tags.
Resolves Issue #274.
2010-12-15 14:15:53 -08:00
Nathan Gass
a312d2a8ae Use top-level header at end as bibliography title for natbib and biblatex output. 2010-12-15 10:21:56 -08:00
Nathan Gass
8f60176511 Remove punctuation at start of suffix for natbib and biblatex output.
This is necessary as the latex citation commands include there own
punctuation, which resulted in doubled commas for markdown documents
where citeproc output works correctly.
2010-12-15 10:21:53 -08:00
Nathan Gass
43fee5e7f7 Support multiple bibliography files with natbib and biblatex output. 2010-12-15 10:21:47 -08:00
John MacFarlane
63d5e0c5f9 Added 'normalize' to Text.Pandoc.Shared. 2010-12-14 20:04:37 -08:00
Nathan Gass
53cb199bab Added normalize funcion to latex citation tests.
This is necessary because converting from markdown to latex correctly
changes hyphens to en-dashes and some spaces to non-breaking spaces.
Converting back to markdown does not undo this changes, and so the
tests have to undo them.
2010-12-14 19:41:22 -08:00
John MacFarlane
3ac6f72f98 Fixed preamble parsing in LaTeX reader. 2010-12-14 19:34:28 -08:00
Nathan Gass
34d30efc5c Added citation tests.
Added tests for latex  citation writer and reader,
markdown citation writer and additional markup in citations.
2010-12-14 18:38:40 -08:00
John MacFarlane
128cf46089 Fixed regression in parsing _emph_
There was a bug in parsing '_emph_, ...':  when followed by
a comma, underscore emphasis did not register.  (Thanks to
gwern for pointing this out.)

This bug was introduced by the change in
c66921f2ac
2010-12-14 18:23:26 -08:00
Nathan Gass
2e728df756 Moved special handling of punctuation in suffix out of markdown reader.
This allows different writers to handle punctuation in the suffix
differently.
2010-12-13 20:50:29 -08:00
Nathan Gass
c2d3796439 Added support for latex cite commands in latex reader. 2010-12-13 20:48:19 -08:00
Nathan Gass
e8679c04c7 Disabled colored boxes around cites in latex template. 2010-12-13 20:43:17 -08:00
Nathan Gass
c81495a07a Added option to write citation markup in markdown writer. 2010-12-13 20:42:58 -08:00