aboutsummaryrefslogtreecommitdiff
path: root/Text/Pandoc/Readers
AgeCommit message (Collapse)AuthorFilesLines
2008-12-02LaTeX reader: parse |inline lhs| if source is lhs.fiddlosopher1-2/+9
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1511 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-12-02LaTeX and Markdown readers: Add sourceCode class to haskell code.fiddlosopher2-2/+2
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1510 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-12-02Added lhs support to RST reader.fiddlosopher1-0/+20
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1509 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-12-02Allow LaTeX-style code sections as well as bird-style in lhs markdown.fiddlosopher1-1/+14
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1504 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-12-02LaTeX reader: Added parser for literate haskell code blocks.fiddlosopher1-3/+9
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1499 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-12-02Moved failUnlessLHS to Text.Pandoc.Shared.fiddlosopher1-6/+0
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1498 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-12-02Added literate haskell support for markdown reader.fiddlosopher1-0/+27
+ Added stateLiterateHaskell to parser state. + Added parser for lhsCodeBlock to Markdown reader. + Added --lhs-in option, to treat input as literate haskell. + If first source has extension .lhs, assume --lhs-in. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1497 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-11-25Markdown reader: relax spacing rules for $$ in display math.fiddlosopher1-1/+4
Now space and newlines are allowed after the opening $$ and before the closing $$. However, the display math cannot contain an entirely blank line. Resolves Issue #105. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1494 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-11-06Fixed parsing of RST comment blocks.fiddlosopher1-4/+5
Modified 'unknown directive' in RST reader. Added RST reader tests for comment blocks. Resolves Issue #86 and Debian Bug#500662. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1484 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-11-02Revert "Markdown reader: Ignore blank line after ~~~~~~~~ in delimited code ↵fiddlosopher1-2/+0
blocks." This reverts commit 7ad17fe5cff04e0b68be5c4a08339bb53d3d176d. We will soon have a better way of handling literate haskell. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1481 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-11-01Markdown reader: Allow blank space at end of horizontal rules.fiddlosopher1-1/+1
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1480 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-11-01Markdown reader: cleaner handling of spaces in URLs.fiddlosopher1-11/+6
Consecutive spaces are now collapsed into one %20, and final spaces are removed. Also, a test case has been added. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1477 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-10-31Markdown reader: allow URLs containing spaces.fiddlosopher1-6/+11
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1475 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-10-18HTML reader: Don't interpret contents of <pre> blocks as markdown.fiddlosopher1-1/+13
Added rawVerbatimBlock parser. Resolves Issue #94. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1468 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-10-16Added colons to protocols in unsanitaryURI in HTML reader.fiddlosopher1-10/+10
Closes Issue #88. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1462 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-09-16Markdown reader: Ignore blank line after ~~~~~~~~ in delimited code blocks.fiddlosopher1-0/+2
Rationale: these are useful for literate haskell, but lhs requires a blank line before the haskell code, and we don't want spurious blank lines in the output. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1454 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-09-12Changed list parser so that only the starting list marker matters:fiddlosopher1-45/+34
1. one - two (b) three produces an ordered list with 1., 2., 3. This is the behavior of Markdown.pl. Modified README to document the new behavior. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1438 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-09-08Use Data.List's 'intercalate' instead of custom 'joinWithSep'.fiddlosopher3-12/+12
+ Removed joinWithSep definition from Text.Pandoc.Shared. + Replaced joinWithSep with intercalate + Depend on base >= 3, since in base < 3 intercalate is not included. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1428 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-09-06LaTeX reader: Refactored math parsers, limited support for eqnarray.fiddlosopher1-3/+10
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1426 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-09-06LaTeX reader: Removed specialEnvironment parser.fiddlosopher1-7/+0
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1425 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-09-06LaTeX reader: minor improvements.fiddlosopher1-7/+9
+ parse '{}', if present, after \textless, \textgreater, \textbar, \textbackslash, \ldots. + Parse unescaped special characters verbatim rather than changing them to spaces. This way arguments of unknown commands will appear in braces. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1424 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-09-06LaTeX reader: Fixed regression in list parsingfiddlosopher1-3/+3
(introduced by recent changes to unknownCommand). git-svn-id: https://pandoc.googlecode.com/svn/trunk@1423 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-09-06LaTeX reader: improvements in raw LaTeX parsing.fiddlosopher1-20/+41
+ "loose punctuation" (like {}) parsed as Space + Para elements must contain more than Str "" and Space elements + Added parser for "\ignore" command used in literate haskell. + Reworked unknownCommand and rawLaTeXInline: when not in "parse raw" mode, these parsers simply strip off the command part and allow the arguments to be parsed normally. So, for example, \blorg{\emph{hi}} will be parsed as Emph "hi" rather than Str "{\\emph{hi}}". git-svn-id: https://pandoc.googlecode.com/svn/trunk@1420 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-09-06Changed Float to Double in definition of Table element.fiddlosopher1-3/+3
(Double is more efficient in GHC.) Truncate width in opendocument output to 2 decimal places. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1418 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-08-26LaTeX reader: Parse "code" environments as verbatim (lhs).fiddlosopher1-15/+9
Refactored parsers for verbatim environments. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1414 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-08-13Support for display math; changed ASCIIMathML -> LaTeXMathML:fiddlosopher2-38/+34
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
2008-08-11Parse raw ConTeXt environments as TeX in markdown reader.fiddlosopher2-13/+37
Resolves Issue #73. Also made some structural changes to parsing of raw LaTeX environments. Previously there was a special block parser for LaTeX environments. It returned a Para element containing the raw TeX inline. This has been removed, and the raw LaTeX environment parser is now used in the rawLaTeXInline parser. The effect is exactly the same, except that we can now handle consecutive LaTeX and ConTeXt environments not separated by spaces. This new flexibility is required by the example in Issue #73: \placeformula \startformula L_{1} = L_{2} \stopformula API change: The LaTeX reader now exports rawLaTeXEnvironment' (which returns a string) rather than rawLaTeXEnvironment (which returns a block element). This is more likely to be useful in other applications. Added test cases for raw ConTeXt environments to markdown-reader-more.txt. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1405 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-08-10Allow newline before URL in markdown link references. Resolves Issue #81.fiddlosopher1-6/+4
Added tests for this issue in new "markdown-reader-more" tests. Changed RunTests.hs to run these tests. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1401 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-08-06Small improvements to citation parsing in markdown reader.fiddlosopher1-4/+4
(Don't allow blank lines inside citations.) git-svn-id: https://pandoc.googlecode.com/svn/trunk@1382 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-08-05Allow parsing of multiline citations.fiddlosopher1-2/+2
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1381 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-08-04Added support for Cite to Markdown reader, and conditional support for ↵fiddlosopher1-2/+41
citeproc module. + The citeproc cabal configuration option sets the _CITEPROC macro, which conditionally includes code for handling citations. + Added Text.Pandoc.Biblio module. + Made highlighting option default to False. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1376 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-07-23Markdown reader: Parse setext headers before atx headers.fiddlosopher1-1/+1
Test case: # hi ==== parsed by Markdown.pl as an H1 header with contents "# hi". git-svn-id: https://pandoc.googlecode.com/svn/trunk@1334 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-07-15Fixed bug in Markdown parser: regular $s triggering math mode.fiddlosopher1-1/+2
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
2008-07-15Commented out some unneeded code in HTML reader.fiddlosopher1-0/+4
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1325 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-07-15Code cleanup - RST reader.fiddlosopher1-23/+93
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1324 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-07-15LaTeX reader - Code cleanup.fiddlosopher1-16/+76
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1322 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-07-14Code cleanup in LaTeX reader.fiddlosopher1-14/+50
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1320 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-07-13Code cleanup in TexMath reader.fiddlosopher1-1/+14
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1318 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-07-11Added type signatures and fixed other -Wall warnings in Markdown reader.fiddlosopher1-35/+182
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1301 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-07-11Added a few more recognized abbreviations to 'abbrev' parser.fiddlosopher1-1/+2
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1300 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-07-11In smart mode, use nonbreaking spaces after abbreviations in markdown parser.fiddlosopher1-2/+23
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
2008-07-11Treat '\ ' in (extended) markdown as nonbreaking space.fiddlosopher1-1/+4
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
2008-06-17Added type signatures, etc., to eliminate -Wall warnings.fiddlosopher1-16/+86
(except for two warnings about unneeded functions, which might come in handy some day...) git-svn-id: https://pandoc.googlecode.com/svn/trunk@1291 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-06-08Markdown smart typography: Em dashes no longer eat surrounding whitespace.fiddlosopher1-2/+1
Resolves Issue #69. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1279 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-04-20Count anything that isn't a known block (HTML) tag as an inline tagfiddlosopher1-4/+4
(rather than the other way around). Added "html", "head", and "body" to list of block tags. Resolves Issue #66, allowing <lj> to count as an inline tag. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1276 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-03-22The '--sanitize-html' option now examines URIs in markdown linksfiddlosopher2-13/+35
and images, and in HTML href and src attributes. If the URI scheme is not on a whitelist of safe schemes, it is rejected. The main point is to prevent cross-site scripting attacks using 'javascript:' URIs. See http://www.mail-archive.com/markdown-discuss@six.pairlist.net/msg01186.html and http://ha.ckers.org/xss.html. Resolves Issue #62. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1262 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-02-09Factored codeBlock into separate codeBlockIndented and codeBlockDelimited.fiddlosopher1-5/+4
Do not use codeBlockDelimited in strict mode. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1211 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-02-09Use generic attributes type, not a string, for CodeBlocks.fiddlosopher4-15/+38
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1209 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-02-09Fixed delimited code blocks: eat blank lines afterwards, and allow end linefiddlosopher1-1/+2
to contain more tildes than beginning line. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1206 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-02-09Added a needed try to {} attribute parser.fiddlosopher1-4/+4
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1205 788f1e2b-df1e-0410-8736-df70ead52e1b