aboutsummaryrefslogtreecommitdiff
path: root/Text/Pandoc
AgeCommit message (Collapse)AuthorFilesLines
2008-01-08Changed copyright dates where appropriate to include 2008.fiddlosopher8-16/+16
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1181 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-01-08Changed comment used to replace unsafe HTML if sanitize-html optionfiddlosopher1-4/+4
selected. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1178 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-01-06RST reader: Fixed bug in parsing explicit links (resolves Issue #44).fiddlosopher1-2/+3
The problem was that we were looking for inlines until a '<' character signaled the start of the URL. So if you hit a reference-style link, it would keep looking til the end of the document. Fix: change inline => (notFollowedBy (char '`') >> inline). Note that this won't allow code inlines in links, but these aren't allowed in resT anyway. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1175 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-01-06RST reader: cleaned up parsing of reference names in key blocks and links.fiddlosopher1-24/+25
Allow nonquoted reference links to contain isolated '.', '-', '_', so so that strings like 'a_b_' count as links. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1174 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-01-06RST reader: Removed unnecessary check for following link in str.fiddlosopher1-2/+1
This is unnecessary now that link is above str in the definition of 'inline'. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1173 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-01-06Fixed markdown reader to handle "*hi **there***" as a strong nested in an emph.fiddlosopher1-2/+3
(A '*' is only recognized as the end of the emphasis if it's not the beginning of a strong emphasis.) git-svn-id: https://pandoc.googlecode.com/svn/trunk@1172 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-01-06Markdown reader: Moved blockQuote parser before list parsers.fiddlosopher1-2/+2
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1171 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-01-04Use an interpreted text role to render math in restructuredText.fiddlosopher1-7/+20
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
2008-01-04Refactored RST writer to usea record instead of a tuple for state,fiddlosopher1-125/+135
and to include options in state so it doesn't need to be passed as a parameter. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1167 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-01-03Added optional HTML sanitization using a whitelist.fiddlosopher3-23/+89
When this option is specified (--sanitize-html on the command line), unsafe HTML tags will be replaced by HTML comments, and unsafe HTML attributes will be removed. This option should be especially useful for those who want to use pandoc libraries in web applications, where users will provide the input. + Main.hs: Added --sanitize-html option. + Text.Pandoc.Shared: Added stateSanitizeHTML to ParserState. + Text.Pandoc.Readers.HTML: - Added whitelists of sanitaryTags and sanitaryAttributes. - Added parsers to check these lists (and state) to see if a given tag or attribute should be counted unsafe. - Modified anyHtmlTag and anyHtmlEndTag to replace unsafe tags with comments. - Modified htmlAttribute to remove unsafe attributes. - Modified htmlScript and htmlStyle to remove these elements if unsafe. - Modified rawHtmlBlock to use anyHtmlBlockTag instead of anyHtmlTag and anyHtmlEndTag. This fixes a bug in markdown parsing, where inline tags would be included in raw HTML blocks. - Modified anyHtmlBlockTag to test for (not inline) rather than directly for block. This allows us to handle e.g. docbook in the markdown reader. - Minor tweaks in nonTitleNonHead and parseTitle. + Text.Pandoc.Readers.Markdown: - In non-strict mode use rawHtmlBlocks instead of htmlBlock. Simplified htmlBlock, since we know it's only called in strict mode. + Modified README and man pages to document new option. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1166 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-31Fixed bug in the markdown reader: HTML preceding a code blockfiddlosopher2-7/+13
could cause it to be parsed as a paragraph. (The problem is that the HTML parser used to eat all blank space after an HTML block, including the indentation of the code block.) Resolves Issue #39. + In Text.Pandoc.Readers.HTML, removed parsing of following space from rawHtmlBlock. + In Text.Pandoc.Readers.Markdown, modified rawHtmlBlocks so that indentation is eaten *only* on the first line after the HTML block. This means that in <div> foo <div> the foo won't be treated as a code block, but in <div> foo </div> it will. This seems the right approach for least suprise. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1164 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-31HTML reader: Finished fixing Issue #40.fiddlosopher1-2/+2
Contents of script tags were still being treated as markdown when the script tags were parsed as inline. Fixed by moving "script" from the list of tags that can be either block or inline to the list of block tags. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1163 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-31HTML reader: Don't interpret contents of style tags as markdown.fiddlosopher1-2/+9
Resolves Issue #40. + Added htmlStyle, analagous to htmlScript. + Use htmlStyle in htmlBlockElement and rawHtmlInline. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1162 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-30Fixed bug in HTML reader: it was looking for <IT> tag, not <I>.fiddlosopher1-1/+1
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1161 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-30Made LaTeX reader properly recognize --parse-raw in rawLaTeXInline.fiddlosopher1-2/+4
Updated LaTeX reader test to use --parse-raw. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1160 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-29Changed handling of titles in HTML writer so you don't get "titleprefix - "fiddlosopher1-2/+4
followed by nothing. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1159 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-29Use wrappers around Doc elements to ensure proper spacing in ConTeXt writer.fiddlosopher1-21/+29
Each block element is wrapped with either Pad or Reg. Pad'ed elements are guaranteed to have a blank line in between. Updated ConTeXt tests. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1158 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-29Markdown reader: Make 'block' conditional on strictness state,fiddlosopher1-21/+27
instead of using failIfStrict in block parsers. Use a different ordering of parsers in strict mode: raw HTML block before paragraph. This recovers performance that was lost in strict mode with r1154. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1157 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-24Markdown: better handling of parentheses in URLs and quotation marks in titles.fiddlosopher1-8/+15
+ source parser first tries to parse URL with balanced parentheses; if that doesn't work, it tries to parse everything beginning with '(' and ending with ')'. + source parser now uses an auxiliary function source'. + linkTitle parser simplified and improved, under assumption that it will be called in context of source'. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1156 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-24Modified markdown reader to disallow links within links. (Resolves Issue #35.)fiddlosopher1-22/+29
+ Replaced inlinesInBalanced with inlinesInBalancedBrackets, which instead of hard-coding the inline parser takes an inline parser as a parameter. + Modified reference and inlineNote to use inlinesInBalancedBrackets. + Removed unneeded inlineString function. + Added inlineNonLink parser, which is now used in the definition of reference. + Added inlineParsers list and redefined inline and inlineNonLink parsers in terms of it. + Added failIfLink parser. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1155 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-24Improved handling of raw HTML in Markdown reader. (Resolves Issue #36.)fiddlosopher1-4/+12
Tags that can be either block or inline (e.g. <ins>) should be treated as block when appropriate and as inline when appropriate. Thus, for example, <ins>hi</ins> should be treated as a paragraph with inline <ins> tags, while <ins> hi </ins> should be treated as a paragraph within <ins> tags. + Moved htmlBlock after para in list of block parsers. This ensures that tags that can be either block or inline get parsed as inline when appropriate. + Modified rawHtmlInline' so that block elements aren't treated as inline. + Modified para parser so that paragraphs containing only HTML tags and blank space are not allowed. Treat these as raw HTML blocks instead. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1154 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-24Changed failure message in anyHtmlBlockTag (minor change).fiddlosopher1-1/+1
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1153 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-23Modified rawHtmlBlock in HTML reader so it parses </html> and </body> tags.fiddlosopher1-2/+7
This allows these tags to be handled correctly in Markdown. HTML reader now uses rawHtmlBlock', which excludes </html> and </body>, since these are handled in parseHtml. (Resolves Issue #38.) git-svn-id: https://pandoc.googlecode.com/svn/trunk@1152 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-21Modified 'source' parser in Markdown reader to allow backslash escapes in URLs.fiddlosopher1-3/+4
So, for example, [my](/url\(1\)) yields a link to /url(1). Resolves Issue #34. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1151 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-21Modified rules for HTML header identifiers to ensure legal identifiers.fiddlosopher1-13/+16
+ Modified htmlListToIdentifier and uniqueIdentifier in HTML writer to ensure that identifiers begin with an alphabetic character. + The new rules are described in README. + Resolves Issue #33. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1150 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-21Fixed handling of email addresses in markdown and reStructuredText.fiddlosopher3-40/+36
Consolidated uri and email address parsers. (Resolves Issue #37.) + New emailAddress and uri parsers in Text.Pandoc.Shared. uri parser uses parseURI from Network.URI. emailAddress parser properly handles email addresses with periods in them. + Removed uri and emailAddress parsers from Text.Pandoc.Readers.RST. + Removed uri and emailAddress parsers from Text.Pandoc.Readers.Markdown. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1149 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-08Removed support for "box-style" block quotes in markdown.fiddlosopher1-12/+2
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
2007-12-04Improvements to LaTeX and ConTeXt footnote handling:fiddlosopher2-5/+7
+ ConTeXt: } at end of footnote now occurs on a new line when the footnote ends with \stoptyping, just as in LaTeX writer. + LaTeX and ConTeXt: \footnote is no longer indented. The indentation causes problems with wrapping, as it makes the line too long. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1137 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-02If gladtex specified, don't prettyprint <EQ> tags, or gladtex gets confused.fiddlosopher1-1/+1
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1136 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-02Small fix to error handling in TeXMath parser:fiddlosopher1-3/+3
+ misc now parses anything but a '}' character + if there's a TeX parsing error, the string is included verbatim and no error is issued. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1135 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-02TeXMath parser: use emphasis only for letters, not numbers.fiddlosopher1-4/+8
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1132 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-02Put math in HTML inside <span class="math">.fiddlosopher1-1/+2
This way it can be distinguished from the surrounding text, e.g. put in a different font. Updated README accordingly. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1130 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-02Added Text.Pandoc.Readers.TeXMath and changed default handling of math.fiddlosopher6-18/+237
+ Text.Pandoc.Readers.TeXMath exports readTeXMath, which reads raw TeX math and outputs a string of pandoc inlines that tries to render it as far as possible, lapsing into literal TeX when needed. + Added Text.Pandoc.Readers.TeXMath to pandoc.cabal + ghc66 version. + Modified writers so that readTeXMath is used for default HTMl output in HTML, S5, RTF, Docbook. + Updated README with information about how math is rendered in all formats. + Updated test suite. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1129 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-01Added --gladtex and --mimetex options.fiddlosopher1-1/+5
+ New HTMLMathMethod structure in WriterOptions keeps track of how to display math in HTML output. + If none of the special options are selected, default to displaying TeX math verbatim, with no enclosing $'s, in HTML. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1125 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-12-01Added HTMLMathMethod writer option.fiddlosopher2-13/+24
This selects between asciimathml, mimetex, gladtex, and plain math. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1123 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-11-29Changed all writers to handle new Math block element.fiddlosopher8-8/+19
This allows TeX element to be handled differently (and in many output formats, simply ignored). git-svn-id: https://pandoc.googlecode.com/svn/trunk@1118 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-11-29Modified markdown reader for new Math block.fiddlosopher1-1/+1
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1115 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-11-29Modified LaTeX reader for new Math blocks.fiddlosopher1-3/+3
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1114 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-11-29Modified refsMatch for new Math block element.fiddlosopher1-0/+2
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1113 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-11-29Added new Math block element.fiddlosopher1-0/+1
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1112 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-11-29Moved everything from src into the top-level directory.fiddlosopher17-0/+6822
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1104 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-11-28Removed Text directory. This is a remnant of an experimentfiddlosopher20-6967/+0
moving the contents of src/ to the top level, and should have been deleted long ago. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1097 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-11-03Use template haskell to avoid the need for templates:fiddlosopher20-0/+6967
+ Added library Text.Pandoc.Include, with a template haskell function $(includeStrFrom fname) to include a file as a string constant at compile time. + This removes the need for the 'templates' directory or Makefile target. These have been removed. + The base source directory has been changed from src to . + A new 'data' directory has been added, containing the ASCIIMathML.js script, writer headers, and S5 files. + The src/wrappers directory has been moved to 'wrappers'. + The Text.Pandoc.ASCIIMathML library is no longer needed, since Text.Pandoc.Writers.HTML can use includeStrFrom to include the ASCIIMathML.js code directly. It has been removed. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1063 788f1e2b-df1e-0410-8736-df70ead52e1b