summaryrefslogtreecommitdiff
path: root/tests/writer.rst
Commit message (Collapse)AuthorAge
* Adjusted writers and tests for change in parsing of div/span.John MacFarlane2013-08-18
| | | | | Textile, MediaWiki, Markdown, Org, RST will emit raw HTML div tags for divs. Otherwise Div and Span are "transparent" block containers.
* RST writer: Fixes bug with links with duplicate text.John MacFarlane2013-01-13
| | | | | | | | | We now (a) use anonymous links for links with inline URLs, and (b) use an inline link instead of a reference link if the reference link would require a label that has already been used for a different link. Closes #511.
* Use line block in RST writer when a paragraph contains linebreaks.John MacFarlane2013-01-13
| | | | | Previously linebreaks weren't supported in RST, since RST has no native linebreak construct.
* RST writer: Don't add ":align: center" to figures.John MacFarlane2012-11-04
|
* RST writer: Better handling of inline formatting.John MacFarlane2012-03-24
| | | | | | | | | * `hi*there*hi` now gets rendered properly as `hi\ *there*\ hi` * Unnecessary '\ ' are avoided around :math:, :sub:, :sup: * Implemented most of the rules in http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#inline-markup-recognition-rules, though some unnecessary '\ ' may be inserted when unicode quotes are used.
* Support for math in RST reader and writer.John MacFarlane2011-12-31
| | | | | | | | | | | | | | | | Inline math uses the :math:`...` construct. Display math uses .. math:: ... or if multilin .. math:: ... These seem to be supported now by rst2latex.py.
* Added blank comment after directives in rst template.John MacFarlane2011-12-04
| | | | Closes #321.
* Bumped version to 1.8; depend on pandoc-types 1.8.John MacFarlane2011-01-26
| | | | | | | The old TeX, HtmlInline and RawHtml elements have been removed and replaced by generic RawInline and RawBlock elements. All modules updated to use the new raw elements.
* Added new prettyprinting module.John MacFarlane2010-12-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Made spacing at end of output more consistent.John MacFarlane2010-07-20
| | | | | | | | | | | | Previously some of the writers added spurious whitespace. This has been removed, resolving Issue #232. NOTE: If your application combines pandoc's output with other text, for example in a template, you may need to add spacing. For example, a pandoc-generated markdown file will not have a blank line after the final block element. If you are inserting it into another markdown file, you will need to make sure there is a blank line between it and the next block element.
* Use unicode for smart punctuation in plain, markdown, rst formats.John MacFarlane2010-06-30
|
* RST writer: handle images in figures.fiddlosopher2010-03-18
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@1899 788f1e2b-df1e-0410-8736-df70ead52e1b
* Improved RST writer.fiddlosopher2009-12-31
| | | | | | Updated test suite. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1725 788f1e2b-df1e-0410-8736-df70ead52e1b
* Fixed RST writer to use new templates.fiddlosopher2009-12-31
| | | | | | | | | Use stHasMath instead of stIncludes. This gives the user more control over how the math directive is defined. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1715 788f1e2b-df1e-0410-8736-df70ead52e1b
* Improved syntax for markdown definition lists.fiddlosopher2009-12-07
| | | | | | | | | | | | | | | | | | | Definition lists are now more compatible with PHP Markdown Extra. Resolves Issue #24. + You can have multiple definitions for a term (but still not multiple terms). + Multi-block definitions no longer need a column before each block (indeed, this will now cause multiple definitions). + The marker no longer needs to be flush with the left margin, but can be indented at or two spaces. Also, ~ as well as : can be used as the marker (this suggestion due to David Wheeler.) + There can now be a blank line between the term and the definitions. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1656 788f1e2b-df1e-0410-8736-df70ead52e1b
* Fixed problems in RST and markdown output due to bug in pretty-1.0.1.0fiddlosopher2008-12-17
| | | | | | | | | | | | | + Added hang' function to Text.Pandoc.Shared; this will be used instead of hang, which doesn't work properly in pretty-1.0.1.0. When pretty is upgraded, we can go back to hang. See http://article.gmane.org/gmane.comp.lang.haskell.general/16687 + Use hang' (and some different techniques) in RST and markdown writers. Some output is now a bit different. + Modify test suites accordingly. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1515 788f1e2b-df1e-0410-8736-df70ead52e1b
* Support for display math; changed ASCIIMathML -> LaTeXMathML:fiddlosopher2008-08-13
| | | | | | | | | | | | | | | | | | | | | | | | | | Resolves Issue #47. + Added a DisplayMath/InlineMath selector to Math inlines. + Markdown parser yields DisplayMath for $$...$$. + LaTeX parser yields DisplayMath when appropriate. Removed mathBlock parsers, since the same effect is achieved by the math inline parsers, now that they handle display math. + Writers handle DisplayMath as appropriate for the format. + Changed -m option to use LaTeXMathML rather than ASCIIMathML. LaTeXMathML is closer to LaTeX in its display of math, and supports many non-math LaTeX environments. + Modified HTML writer to print raw TeX when LaTeXMathML is being used instead of suppressing it. + Removed ASCIIMathML files from data/ and added LaTeXMathML. + Replaced ASCIIMathML with LaTeXMathML in source files. + Modified README and pandoc man page source. + Modified web page. + Added --latexmathml option (kept --asciimathml as a synonym for backwards compatibility) + Modified tests accordingly; added new tests for display math. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1409 788f1e2b-df1e-0410-8736-df70ead52e1b
* Fixed bug in Markdown parser: regular $s triggering math mode.fiddlosopher2008-07-15
| | | | | | | | | | | | | For example: "shoes ($20) and socks ($5)." The fix consists in two new restrictions: + the $ that ends a math span may not be directly followed by a digit. + no blank lines may be included within a math span. Thanks to Joseph Reagle for noticing the bug. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1326 788f1e2b-df1e-0410-8736-df70ead52e1b
* In smart mode, use nonbreaking spaces after abbreviations in markdown parser.fiddlosopher2008-07-11
| | | | | | | | Thus, for example, "Mr. Brown" comes out as "Mr.~Brown" in LaTeX, and does not produce a sentence-separating space. Resolves Issue #75. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1298 788f1e2b-df1e-0410-8736-df70ead52e1b
* Treat '\ ' in (extended) markdown as nonbreaking space.fiddlosopher2008-07-11
| | | | | | | Print nonbreaking space appropriately in each writer (e.g. ~ in LaTeX). git-svn-id: https://pandoc.googlecode.com/svn/trunk@1297 788f1e2b-df1e-0410-8736-df70ead52e1b
* Markdown smart typography: Em dashes no longer eat surrounding whitespace.fiddlosopher2008-06-08
| | | | | | | Resolves Issue #69. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1279 788f1e2b-df1e-0410-8736-df70ead52e1b
* Use an interpreted text role to render math in restructuredText.fiddlosopher2008-01-04
| | | | | | | | See http://www.american.edu/econ/itex2mml/mathhack.rst for the strategy. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1168 788f1e2b-df1e-0410-8736-df70ead52e1b
* Removed support for "box-style" block quotes in markdown.fiddlosopher2007-12-08
| | | | | | | | | This adds unneeded complexity and makes pandoc diverge further than necessary from other markdown extensions. Brought documentation, tests, and debian/changelog up to date. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1141 788f1e2b-df1e-0410-8736-df70ead52e1b
* Modified writer tests for new Math and TeX output.fiddlosopher2007-11-29
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@1119 788f1e2b-df1e-0410-8736-df70ead52e1b
* + Fixed bug in RST writer's handling of ordered lists. Previously,fiddlosopher2007-09-10
| | | | | | | | | | | | 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
* Added new rule for enhanced markdown ordered lists: if the list markerfiddlosopher2007-08-23
| | | | | | | | | | | | | | | | | is a capital letter followed by a period (including a single-letter capital roman numeral), then it must be followed by at least two spaces. The point of this is to avoid accidentally treating people's initials as list markers: a paragraph may begin: B. Russell was an English philosopher. and this shouldn't be treated as a list. Modified Markdown reader and README documentation. Added a test case. git-svn-id: https://pandoc.googlecode.com/svn/trunk@880 788f1e2b-df1e-0410-8736-df70ead52e1b
* + Fixed bug in markdown ordered list parsing. The problem wasfiddlosopher2007-08-18
| | | | | | | | | | | | that anyOrderedListStart did not check for a space following the ordered list marker. So, 'A.B. 2007' would be parsed as a list item, then fail because of the lack of space after 'A.' (required by orderedListStart). Resolves Issue #22. + Fixed a similar problem in RST reader. + Added regression test. git-svn-id: https://pandoc.googlecode.com/svn/trunk@861 788f1e2b-df1e-0410-8736-df70ead52e1b
* Major change in the way ordered lists are handled:fiddlosopher2007-08-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + The changes are documented in README, under Lists. + The OrderedList block element now stores information about list number style, list number delimiter, and starting number. + The readers parse this information, when possible. + The writers use this information to style ordered lists. + Test suites have been changed accordingly. Motivation: It's often useful to start lists with numbers other than 1, and to have control over the style of the list. Added to Text.Pandoc.Shared: + camelCaseToHyphenated + toRomanNumeral + anyOrderedListMarker + orderedListMarker + orderedListMarkers Added to Text.Pandoc.ParserCombinators: + charsInBalanced' + withHorizDisplacement + romanNumeral RST writer: + Force blank line before lists, so that sublists will be handled correctly. LaTeX reader: + Fixed bug in parsing of footnotes containing multiple paragraphs, introduced by use of charsInBalanced. Fix: use charsInBalanced' instead. LaTeX header: + use mathletters option in ucs package, so that basic unicode Greek letters will work properly. git-svn-id: https://pandoc.googlecode.com/svn/trunk@834 788f1e2b-df1e-0410-8736-df70ead52e1b
* Brought test suite up to date.fiddlosopher2007-07-28
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@828 788f1e2b-df1e-0410-8736-df70ead52e1b
* Updated test suite for writers, adding tests forfiddlosopher2007-07-22
| | | | | | | strikeout, superscript, subscript. git-svn-id: https://pandoc.googlecode.com/svn/trunk@766 788f1e2b-df1e-0410-8736-df70ead52e1b
* Added a test case with an inline link containing bracketed text.fiddlosopher2007-07-09
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@667 788f1e2b-df1e-0410-8736-df70ead52e1b
* Updated test suite with new tests for definition lists.fiddlosopher2007-05-10
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@597 788f1e2b-df1e-0410-8736-df70ead52e1b
* Extensive changes stemming from a rethinking of the Pandoc datafiddlosopher2007-04-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fixed bug in Markdown reader's handling of underscores and otherfiddlosopher2007-01-06
| | | | | | | | | 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
* Merged changes from 'quotes' branch since r431. Smart typographyfiddlosopher2007-01-06
| | | | | | | | | 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
* + Improved text wrapping algorithm in markdown, docbook, and RST writers.fiddlosopher2007-01-04
| | | | | | | | | 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
* Merged 'strict' branch from r324. This adds a '--strict'fiddlosopher2006-12-30
| | | | | | | | 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
* + Added regression tests with footnotes in quote blocks and lists.fiddlosopher2006-12-21
| | | | | | | | | + 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
* Merged changes to footnotes branch r219-r240.fiddlosopher2006-12-19
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@241 788f1e2b-df1e-0410-8736-df70ead52e1b
* Changed footnote syntax to conform to the de facto standardfiddlosopher2006-12-19
| | | | | | | | | | 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
* Changed 'putStrLn' to 'putStr' in Main.hs, and modified somefiddlosopher2006-12-16
| | | | | | | | 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
* initial importfiddlosopher2006-10-17
git-svn-id: https://pandoc.googlecode.com/svn/trunk@2 788f1e2b-df1e-0410-8736-df70ead52e1b