aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
AgeCommit message (Collapse)AuthorFilesLines
2016-08-29Org reader: respect `author` export optionAlbert Krewinkel4-4/+23
The `author` option controls whether the author should be included in the final markup. Setting `#+OPTIONS: author:nil` will drop the author from the final meta-data output.
2016-08-29Org reader: read HTML_head as header-includesAlbert Krewinkel1-0/+2
HTML-specific head content can be defined in `#+HTML_head` lines. They are parsed as format-specific inlines to ensure that they will only show up in HTML output.
2016-08-29Org reader: set classoption meta from LaTeX_class_optionsAlbert Krewinkel1-1/+8
2016-08-29Org reader: set documentclass meta from LaTeX_classAlbert Krewinkel1-0/+1
2016-08-29Org reader: read LaTeX_header as header-includesAlbert Krewinkel1-9/+31
LaTeX-specific header commands can be defined in `#+LaTeX_header` lines. They are parsed as format-specific inlines to ensure that they will only show up in LaTeX output.
2016-08-29Org reader: give precedence to later meta linesAlbert Krewinkel1-1/+1
The last meta-line of any given type is the significant line. Previously the value of the first line was kept, even if more lines of the same type were encounterd.
2016-08-29Org reader: allow multiple, comma-separated authorsAlbert Krewinkel1-1/+9
Multiple authors can be specified in the `#+AUTHOR` meta line if they are given as a comma-separated list.
2016-08-29Org reader: read markup only for special meta keysAlbert Krewinkel1-5/+20
Most meta-keys should be read as normal string values, only a few are interpreted as marked-up text.
2016-08-29Org reader: extract meta parsing code to moduleAlbert Krewinkel2-64/+111
Parsing of meta-data is well separable from other block parsing tasks. Moving into new module to get small files and clearly arranged code.
2016-08-15StyleMap: export functions on StyleMap instancesJesse Rosenthal1-0/+2
We're going to want `getMap` in the Docx Writer.
2016-08-13Docx parser: Use xml convenience functionsJesse Rosenthal1-38/+27
The functions `isElem` and `elemName` (defined in Docx/Util.hs) make the code a lot cleaner than the original XML.Light functions, but they had been used inconsistently. This puts them in wherever applicable.
2016-08-11Merge pull request #3048 from tarleb/latex-mini-fixJohn MacFarlane1-1/+1
LaTeX reader: drop duplicate `*` in bibtexKeyChars
2016-08-09Merge pull request #3065 from tarleb/org-verse-indentJohn MacFarlane1-1/+10
Org reader: preserve indentation of verse lines
2016-08-09Org reader: ensure image sources are proper linksAlbert Krewinkel3-39/+53
Image sources as those in plain images, image links, or figures, must be proper URIs or relative file paths to be recognized as images. This restriction is now enforced for all image sources. This also fixes the reader's usage of uncleaned image sources, leading to `file:` prefixes not being deleted from figure images (e.g. `[[file:image.jpg]]` leading to a broken image `<img src="file:image.jpg"/>) Thanks to @bsag for noticing this bug.
2016-08-08Org reader: preserve indentation of verse linesAlbert Krewinkel1-1/+10
Leading spaces in verse lines are converted to non-breaking spaces, so indentation is preserved. This fixes #3064.
2016-08-06MediaWiki reader: properly interpret XML tags in pre environments.John MacFarlane1-3/+2
They are meant to be interpreted as literal text in textile. Closes #3042.
2016-08-06Improved mediawiki reader's treatment of verbatim constructions.John MacFarlane1-7/+13
Previously these yielded strings of alternating Code and Space elements; we now incorporate the spaces into the Code. Emphasis etc. is still possible inside these. Closes #3055.
2016-08-06Fix for unquoted attribute values in mediawiki tables.John MacFarlane1-1/+1
Previously an unquoted attribute value in a table row could cause parsing problems. Fixes #3053 (well, proper rowspans and colspans aren't created, but that's a bigger limitation with the current Pandoc document model for tables).
2016-07-29LaTeX reader: drop duplicate `*` in bibtexKeyCharsAlbert Krewinkel1-1/+1
2016-07-22Textile reader: disallow empty URL in explicit link.John MacFarlane1-1/+1
Closes #3036.
2016-07-22Textile reader: support `bc..` extended code blocks.John MacFarlane1-5/+25
Also, remove trailing newline in code blocks (consistently with Markdown reader).
2016-07-20LaTeX reader: be more forgiving of non-standard characters.John MacFarlane1-1/+1
E.g. `^` outside of math. Some custom environments give these a meaning, so we should try not to fall over when we encounter them.
2016-07-20LaTeX reader: more robust parsing of unknown environments.John MacFarlane1-2/+9
We no longer fail on things like `^` inside options for tikz. Closes #3026.
2016-07-20RST reader: use Div for admonitions.John MacFarlane1-8/+6
Previously blockquotes were used. Now a Div is used with class `admonition` and (if relevant) one of the following: `attention`, `caution`, `danger`, `error`, `hint`, `important`, `note`, `tip`, `warning`. `sidebar` is also put into a Div. Note: This will change rendering of RST documents! It should provide much more flexibility. Closes #3031.
2016-07-19Textile reader: improve definition list parsing.John MacFarlane1-6/+13
- Allow multiple terms (which we concatenate with linebreaks). - Fix exponential parsing bug (closes #3020 for real this time).
2016-07-18Textile reader: improved table parsing.John MacFarlane1-22/+62
We now handle cell and row attributes, mostly by skipping them. However, alignments are now handled properly. Since in pandoc alignment is per-column, not per-cell, we try to devine column alignments from cell alignments. Table captions are also now parsed, and textile indicators for thead and tfoot no longer cause parse failure. (However, a row designated as tfoot will just be a regular row in pandoc.)
2016-07-15Don't require haddock-library 1.4.John MacFarlane1-0/+4
Instead use CPP to work around version differences.
2016-07-14Fixed compiler warnings.John MacFarlane2-5/+5
2016-07-14Haddock reader - support math.John MacFarlane1-0/+4
The Haddock document model added elements for math in 1.4.
2016-07-14Removed some redundant class constraints.John MacFarlane1-3/+3
2016-07-14Merge pull request #3019 from tarleb/org-verbatim-fixJohn MacFarlane1-2/+4
Org reader: fix parsing of verbatim inlines
2016-07-14Fixed exponential parsing bug in textile reader.John MacFarlane1-0/+1
Closes #3020.
2016-07-14Org reader: fix parsing of verbatim inlinesAlbert Krewinkel1-2/+4
Org rules for allowed characters before or after markup chars were not checked for verbatim text. This resultet in wrong parsing outcomes of if the verbatim text contained e.g. space enclosed markup characters as part of the text (`=is_substr = True=`). Forcing the parser to update the positions of allowed/forbidden markup border characters fixes this. This fixes #3016.
2016-07-04Org reader: replace ugly code with view patternAlbert Krewinkel1-5/+4
Some less-than-smart code required a pragma switching of overlapping pattern warnings in order to compile seamlessly. Using view patterns makes the code easier to read and also doesn't require overlapping pattern checks to be disabled.
2016-07-03Merge pull request #3010 from tarleb/org-header-treeJohn MacFarlane4-247/+386
Org reader: support archived trees, headline levels export setting
2016-07-03Odt reader: Removed redundant Monoid constraints.John MacFarlane1-7/+7
2016-07-03Org reader: support headline levels export settingAlbert Krewinkel3-8/+40
The depths of headlines can be modified using the `H` option. Deeper headlines will be converted to lists.
2016-07-02Org reader: put export setting parser into moduleAlbert Krewinkel3-191/+191
Export option parsing is distinct enough from general block parsing to justify putting it into a separate module.
2016-07-01LaTeX reader: strip off double quotes around image source if present.John MacFarlane1-1/+8
Avoids interpreting these as part of the literal filename. See #2825.
2016-07-01Org reader: support archived trees export optionsAlbert Krewinkel2-8/+62
Handling of archived trees can be modified using the `arch` option. Archived trees are either dropped, exported completely, or collapsed to include just the header when the `arch` option is nil, non-nil, or `headline`, respectively.
2016-07-01Org reader: refactor comment tree handlingAlbert Krewinkel2-39/+21
Comment trees were handled after parsing, as pattern matching on lists is easier than matching on sequences. The new method of reading documents as trees allows for more elegant subtree removal.
2016-07-01Org reader: parse as headlines, convert to blocksAlbert Krewinkel1-47/+86
Emacs org-mode is based on outline-mode, which treats documents as trees with headlines are nodes. The reader is refactored to parse into a similar tree structure. This simplifies transformations acting on document (sub-)trees.
2016-07-01Org reader: improve tag and properties type safetyAlbert Krewinkel1-25/+57
Specific newtype definitions are used to replace stringly typing of tags and properties. Type safety is increased while readability is improved.
2016-06-29LaTeX reader: fixed `\cite` so it is a NormalCitation not AuthorInText.John MacFarlane1-2/+2
2016-06-26Merge pull request #3001 from tarleb/org-figure-labelJohn MacFarlane1-1/+6
Org reader: support figure labels
2016-06-26Org reader: support figure labelsAlbert Krewinkel1-1/+6
Figure labels given as `#+LABEL: thelabel` are used as the ID of the respective image. This allows e.g. the LaTeX to add proper `\label` markup. This fixes half of #2496 and #2999.
2016-06-25Textile reader: Fix overly aggressive interpretation as images.John MacFarlane1-7/+4
Spaces are not allowed in the image URL in textile. Closes #2998.
2016-06-25Fixed RST links with no explicit link text.John MacFarlane1-1/+4
The link `<foo>`_ should have `foo` as both its link text and its URL. See RST spec at <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#embedded-uris-and-aliases> "The reference text may also be omitted, in which case the URI will be duplicated for use as the reference text. This is useful for relative URIs where the address or file name is also the desired reference text: See `<a_named_relative_link>`_ or `<an_anonymous_relative_link>`__ for details." Closes Debian #828167 -- reported by Christian Heller.
2016-06-23Textile reader: fixed attributes.John MacFarlane1-1/+3
Attributes can't be followed by a space. So, _(class)emph_ but _(noclass) emph_ Closes #2984.
2016-06-23Docx reader: Add warning for advanced comment formatting.Jesse Rosenthal1-2/+18
We can't guarantee we'll convert every comment correctly, though we'll do the best we can. This warns if the comment includes something other than Para or Plain.