aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Markdown.hs
AgeCommit message (Collapse)AuthorFilesLines
2012-08-10Changed Ext_tex_math to Ext_tex_math_dollars.John MacFarlane1-2/+2
2012-08-10Markdown: Allow pipe tables created by emacs orgtbl-mode to work.John MacFarlane1-4/+8
The difference is the + separators. Note: only simple org-tables work, with no bottom line. This just allows you to use org-mode's nice table editor to create regular pipe tables. In particular, org-mode's method for determining column alignments implicitly is not enabled. You must put in :s to specify alignments, as stated in the documentation.
2012-08-08Changes to literate haskell options.John MacFarlane1-1/+1
- Removed writerLiterateHaskell from WriterOptions. - Removed readerLiterateHaskell from ReaderOptions. - Added Ext_literate_haskell to Extensions. Test for this instead of the above. - Removed failUnlessLHS from Shared. Note: At this point, +lhs and .lhs extension no longer has any effect. Need to fix.
2012-08-07Markdown reader: Modified to use Builder from pandoc-types 1.10.*.John MacFarlane1-5/+3
2012-08-06Support hard_line_breaks markdown extension.John MacFarlane1-1/+2
* Added Ext_hard_line_breaks. * Added section in README on non-pandoc extensions. * Exported pandocExtensions and strictExtensions in Text.Pandoc.Options. Closes #514.
2012-08-05Started making markdown table writer sensitive to options.John MacFarlane1-1/+1
So far incomplete.
2012-08-04Markdown reader: look for raw html/latex blocks before tables.John MacFarlane1-2/+2
Otherwise the following gets parsed as a table: \begin{code} -------------- -- My comment. \end{code} Closes #578.
2012-08-02Markdown reader: Import <> from Text.Pandoc.Builder.John MacFarlane1-2/+2
This way the module will work with versions of Data.Monoid that don't export <>.
2012-08-02Made F a newtype, moved definitions to Parser.John MacFarlane1-20/+14
Parser now exports F(..), askF, asksF, runF.
2012-08-01Improved implementation of pipe tables.John MacFarlane1-25/+14
2012-08-01Parsing: removed duplication of Key and Key'.John MacFarlane1-4/+4
Now we just use the former Key' (string contents), renamed Key. lookupKeySrc and fromKey are no longer eport. Key', toKey' and KeyTable' have become Key, toKey, and KeyTable.
2012-08-01Major rewrite of markdown reader.John MacFarlane1-390/+553
* Use Builder's Inlines/Blocks instead of lists. * Return values in the reader monad, which are then run (at the end of parsing) against the final parser state. This allows links, notes, and example numbers to be resolved without a second parser pass. * An effect of using Builder is that everything is normalized automatically. * New exports from Text.Pandoc.Parsing: widthsFromIndices, NoteTable', KeyTable', Key', toKey', withQuoteContext, singleQuoteStart, singleQuoteEnd, doubleQuoteStart, doubleQuoteEnd, ellipses, apostrophe, dash * Updated opendocument tests. * Don't derive Show for ParserState. * Benchmarks: markdown reader takes 82% of the time it took before. Markdown writer takes 92% of the time (here the speedup is probably due to the fact that everything is normalized by default).
2012-07-27Markdown reader: Added sensitivity to Ext_example_lists.John MacFarlane1-1/+3
2012-07-27Markdown reader: Check fancy_lists and startnum extensions.John MacFarlane1-2/+6
2012-07-27Replaced writerStrict with writerExtensions in WriterOptions.John MacFarlane1-5/+7
Still have not implemented individual tests for all the extensions in the markdown writer.
2012-07-26Fixed whitespace errors.John MacFarlane1-31/+31
2012-07-26Use readerExtensions instead of readerStrict in readers.John MacFarlane1-84/+72
Test individually for the extensions.
2012-07-25Changed reader parameters from ParserState to ReaderOptions.John MacFarlane1-3/+4
2012-07-25Moved stateApplyMacros, stateIndentedCodeClasses to ReaderOptions.John MacFarlane1-2/+2
2012-07-25stateCitations -> readerCitations.John MacFarlane1-2/+2
2012-07-25Moved stateTabStop to readerTabStop in ReaderOptions.John MacFarlane1-8/+5
2012-07-25Moved ParseRaw from ParserState to ReaderOptions.John MacFarlane1-1/+3
2012-07-25Options -> ReaderOptions.John MacFarlane1-10/+10
Better to keep reader and writer options separate.
2012-07-25Put smart, strict in separate options field in state.John MacFarlane1-10/+11
This is the beginning of a larger transition that will make Options, not ParserState, the parameter of the read functions. (Options will also be used in writers, in place of WriterOptions.) Next step is to remove strict, replacing it with granular tests for different extensions.
2012-07-24Don't require strict HTML blocks to begin at left margin.John MacFarlane1-3/+1
Technically this is required, according to the mardkown syntax document, but Markdown.pl and other markdown processors are more liberal.
2012-07-24Small fix to fix: Allow blank lines btw table and caption.John MacFarlane1-0/+1
2012-07-24Fixed performance improvement to tables.John MacFarlane1-1/+1
2012-07-24More performance improvements on pipe tables.John MacFarlane1-2/+1
2012-07-24Refactored table parsers, captions now not part of core tableWith.John MacFarlane1-9/+15
2012-07-24Slight improvement to performance for pipe tables.John MacFarlane1-11/+16
Still, pipe tables are a huge performance drag. One benchmark: With pipe tables, 1.25 sec (including this fix). without pipe tables, 1.05 sec.
2012-07-22Revised code for pipe tables.John MacFarlane1-5/+51
* All tables now require at least one body row. * Renamed from 'extra' to 'pipe' tables. * Moved functions from Parsing to Readers.Markdown. * Cleaned up code; revised to parse in one pass rather than parsing a raw string, splitting it, and parsing the components. * Allow pipe tables without pipes on the ends (as PHP Markdown Extra does).
2012-07-22Merge pull request #510 from mytskine/markdown-extraJohn MacFarlane1-0/+5
Markdown extra tables [part of the multi-markdown syntax for tables]
2012-07-20Use Parser as type synonym for Parsec.John MacFarlane1-134/+134
2012-07-20Text.Pandoc.Parsing: Export all Parsec functions used in pandoc code.John MacFarlane1-1/+0
No other module directly imports Parsec. This will make it easier to change the parsing backend in the future, if we want to.
2012-07-20Use Text.Parsec instead of Text.ParserCombinators.Parsec.John MacFarlane1-137/+137
2012-06-04Markdown reader: Added cf. and cp. to list of likely abbreviations.John MacFarlane1-1/+1
2012-05-08Treat four or more `~` or `^` in an inline context as regular text.John MacFarlane1-3/+3
This avoids exponential parsing blowups with long strings of these characters. Closes #507.
2012-04-13Markdown reader: Allow lists as list items.John MacFarlane1-6/+8
So, for example: 1. * x * y 2. * z * w
2012-04-12Markdown: don't recognize references inside delimited code blocks.John MacFarlane1-0/+1
Previously pandoc would produce incorrect results on this: ~~~ [not a link]: /url ~~~ [not a link] because it would recognize "not a link" as a reference link definition on the first pass. This fix causes the first pass to skip delimited code blocks.
2012-02-21Added support for markdown-extra tables in the markdown parserFrançois Gannaz1-0/+5
Only tables whose lines begin with a "|" are supported. There are 2 warnings about unused variables when compiling.
2012-02-08Improvements to markdown attributes syntax (on code blocks).John MacFarlane1-4/+5
(1) Attributes can contain line breaks. (2) Values in key-value attributes can be surrounded by either double or single quotes, or left unquoted if they contain no spaces.
2012-02-07Limit nesting of strong/emph.John MacFarlane1-2/+14
This avoids exponential lookahead in parasitic cases, like a**a*a**a*a**a*a**a*a**a*a**a*a**a*a**. Added stateMaxNestingLevel to ParserState. We set this to 6, so you can still have Emph inside Emph, just not indefinitely.
2012-02-05Removed module Text.Pandoc.CharacterReferences.John MacFarlane1-3/+3
Moved characterReference parser to Text.Pandoc.Parsing. decodeCharacterReferences is now replaced by fromEntities in Text.Pandoc.XML.
2012-02-04Complete rewrite of LaTeX reader.John MacFarlane1-12/+9
* The new reader is more robust, accurate, and extensible. It is still quite incomplete, but it should be easier now to add features. * Text.Pandoc.Parsing: Added withRaw combinator. * Markdown reader: do escapedChar before raw latex inline. Otherwise we capture commands like \{. * Fixed latex citation tests for new citeproc. * Handle \include{} commands in latex. This is done in pandoc.hs, not the (pure) latex reader. But the reader exports the needed function, handleIncludes. * Moved err and warn from pandoc.hs to Shared. * Fixed tests - raw tex should sometimes have trailing space. * Updated lhs-test for highlighting-kate changes.
2012-01-28Removed an unnecessary `many spaceChar`.John MacFarlane1-1/+1
2012-01-28Markdown reader: Fixed bug in code block attribute parser.John MacFarlane1-3/+4
Previously the ID attribute got lost if it didn't come first. Now attributes can come in any order.
2012-01-28Support github syntax for fenced code blocks.John MacFarlane1-10/+14
You can now write ```ruby x = 2 ``` instead of ~~~ {.ruby} x = 2 ~~~~
2012-01-27Fixed table parsing with wide or combining characters.John MacFarlane1-4/+4
Closes #348. Closes #108.
2012-01-10Markdown reader: fixed bug in table/hrule parsing.John MacFarlane1-1/+1
Top line of table must not be followed by a blank line. This bug caused slowdown on some files with hrules and tables, and pandoc tried to interpret the hrules as the tops of multiline tables.
2012-01-08Markdown reader: Allow links in image captions.John MacFarlane1-13/+10
This change also means that [link with [link](/url)](/url) will turn into <p><a href="/url">link with link</a></p> instead of <p><a href="/url">link with [link](/url)</a></p>