aboutsummaryrefslogtreecommitdiff
path: root/tests/Tests/Readers/Org.hs
AgeCommit message (Collapse)AuthorFilesLines
2016-08-09Merge pull request #3065 from tarleb/org-verse-indentJohn MacFarlane1-0/+8
Org reader: preserve indentation of verse lines
2016-08-09Org reader: ensure image sources are proper linksAlbert Krewinkel1-9/+9
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-0/+8
Leading spaces in verse lines are converted to non-breaking spaces, so indentation is preserved. This fixes #3064.
2016-07-14Org reader: fix parsing of verbatim inlinesAlbert Krewinkel1-0/+3
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-03Org reader: support headline levels export settingAlbert Krewinkel1-0/+12
The depths of headlines can be modified using the `H` option. Deeper headlines will be converted to lists.
2016-07-01Org reader: support archived trees export optionsAlbert Krewinkel1-0/+24
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-06-29LaTeX reader: fixed `\cite` so it is a NormalCitation not AuthorInText.John MacFarlane1-1/+1
2016-06-26Org reader: support figure labelsAlbert Krewinkel1-31/+41
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-13Org reader: support arbitrary raw inlinesAlbert Krewinkel1-0/+4
Org mode allows arbitrary raw inlines ("export snippets" in Emacs parlance) to be included as `@@format:raw foreign format text@@`. Support for this features is added to the Org reader.
2016-06-05Org reader: add support for "Berkeley-style" citesAlbert Krewinkel1-0/+49
A specification for an official Org-mode citation syntax was drafted by Richard Lawrence and enhanced with the help of others on the orgmode mailing list. Basic support for this citation style is added to the reader. This closes #1978.
2016-05-31Merge pull request #2950 from tarleb/org-ref-supportJohn MacFarlane1-0/+36
Org reader: support org-ref style citations
2016-05-29Org reader: support new syntax for export blocksAlbert Krewinkel1-1/+15
Org-mode version 9 usees a new syntax for export blocks. Instead of `#+BEGIN_<FORMAT>`, where `<FORMAT>` is the format of the block's content, the new format uses `#+BEGIN_export <FORMAT>` instead. Both types are supported.
2016-05-27Org reader: support org-ref style citationsAlbert Krewinkel1-0/+36
The *org-ref* package is an org-mode extension commonly used to manage citations in org documents. Basic support for the `cite:citeKey` and `[[cite:citeKey][prefix text::suffix text]]` syntax is added.
2016-05-23Org reader: respect drawer export settingAlbert Krewinkel1-1/+24
The `d` export option can be used to control which drawers are exported and which are discarded. Basic support for this option is added here.
2016-05-22Org reader/writer: use CUSTOM_ID in propertiesAlbert Krewinkel1-1/+1
The `ID` property is reserved for internal use by Org-mode and should not be used. The `CUSTOM_ID` property is to be used instead, it is converted to the `ID` property for certain export format. The reader and writer erroneously used `ID`. This is corrected by using `CUSTOM_ID` where appropriate.
2016-05-20Org reader: add :PROPERTIES: drawer supportAlbert Krewinkel1-5/+14
Headers can have optional `:PROPERTIES:` drawers associated with them. These drawers contain key/value pairs like the header's `id`. The reader adds all listed pairs to the header's attributes; `id` and `class` attributes are handled specially to match the way `Attr` are defined. This also changes behavior of how drawers of unknown type are handled. Instead of including all unknown drawers, those are not read/exported, thereby matching current Emacs behavior. This closes #1877.
2016-05-19Org reader: add support for ATTR_HTML attributesAlbert Krewinkel1-0/+11
Arbitrary key-value pairs can be added to some block types using a `#+ATTR_HTML` line before the block. Emacs Org-mode only includes these when exporting to HTML, but since we cannot make this distinction here, the attributes are always added. The functionality is now supported for figures. This closes #1906.
2016-05-11Org reader: add support for sub/superscript export optionsAlbert Krewinkel1-0/+6
Org-mode allows to specify export settings via `#+OPTIONS` lines. Disabling simple sub- and superscripts is one of these export options, this options is now supported.
2016-05-09Org reader: fix inline-LaTeX regressionAlbert Krewinkel1-0/+4
The last fix for whitespace handling of inline LaTeX commands was incorrect, preventing correct recognition of inline LaTeX commands which contain spaces. This fix ensures that only trailing whitespace is cut off.
2016-05-05Merge pull request #2898 from tarleb/org-table-refactoringJohn MacFarlane1-5/+16
Org reader: table parsing code refactoring and fixes
2016-05-04Org reader: fix spacing after LaTeX-style symbolsAlbert Krewinkel1-0/+4
The org-reader was droping space after unescaped LaTeX-style symbol commands: `\ForAll \Auml` resulted in `∀Ä` but should give `∀ Ä` instead. This seems to be because the LaTeX-reader treats the command-terminating space as part of the command. Dropping the trailing space from the symbol-command fixes this issue.
2016-05-04Org reader: fix handling of empty table cells, rowsAlbert Krewinkel1-1/+12
This fixes Org mode parsing of some corner cases regarding empty cells and rows. Empty cells weren't parsed correctly, e.g. `|||` should be two empty cells, but would be parsed as a single cell containing a pipe character. Empty rows where parsed as alignment rows and dropped from the output. This fixes #2616.
2016-05-04Org reader: stop padding short table rowsAlbert Krewinkel1-4/+4
Emacs Org-mode doesn't add any padding to table rows. The first row (header or first body row) is used to determine the column count, no other magic is performed. The org reader was padding rows to the length of the longest table row. This was done due to a misunderstanding of how Org handles tables. This feature reflected how Org-mode handles tables when pressing <TAB>. The Org exporter however, which is what the reader should implement, doesn't do any of this. So this was a mis-feature that made the reader more complex and reduced comparability. It was hence removed.
2016-04-26Ignore leading space in org code blocksEmanuel Evans1-0/+27
Fixes #2862 Also fix up tab handling for leading whitespace in code blocks.
2016-02-20Merge pull request #2646 from tarleb/org-figure-with-no-nameJohn MacFarlane1-4/+4
Prefix even empty figure names with "fig:"
2016-01-31Org reader: Refactor link-target processingAlbert Krewinkel1-0/+4
Cleanup of the code for link target handling. Most notably, the canonicalization of a link is handled by a separate function. This fixes #2684.
2016-01-11Prefix even empty figure names with "fig:"Albert Krewinkel1-4/+4
The convention used by pandoc for figures is to mark them by prefixing the name with "fig:". The org reader failed to do this if a figure had no name. The test for this was broken as well. This fixes #2643.
2016-01-07Fix function dropping subtrees tagged :noexport:Albert Krewinkel1-0/+10
Continue scanning for comment subtrees beyond only the first block. Note to self: when writing an recursive function, don't forget to, you know, actually recurse. Shout to @mrvdb for noticing this. This fixes #2628.
2015-12-12Test fixes.John MacFarlane1-20/+20
2015-11-13Merge pull request #2526 from tarleb/org-definition-lists-fixJohn MacFarlane1-1/+5
Org reader: Require whitespace around def list markers
2015-11-13Org reader: Require whitespace around def list markersAlbert Krewinkel1-1/+5
Definition list markers (i.e. double colons `::`) must be surrounded by whitespace to start a definition item. This rule was not checked before, resulting in bugs with footnotes and some link types. Thanks to @conklech for noticing and reporting this issue. This fixes #2518.
2015-11-13Org reader: Fix emphasis rules for smart parsingAlbert Krewinkel1-0/+9
Smart quotes, ellipses, and dashes should behave like normal quotes, single dashes, and dots with respect to text markup parsing. The parser state was not updated properly in all cases, which has been fixed. Thanks to @conklech for reporting this issue. This fixes #2513.
2015-11-09Revert "Use -XNoImplicitPrelude and 'import Prelude' explicitly."John MacFarlane1-1/+0
This reverts commit c423dbb5a34c2d1195020e0f0ca3aae883d0749b.
2015-11-08Merge pull request #2505 from tarleb/org-header-markup-fixJohn MacFarlane1-0/+11
Org reader: fix markup parsing in headers
2015-11-08Use -XNoImplicitPrelude and 'import Prelude' explicitly.John MacFarlane1-0/+1
This is needed for ghci to work with pandoc, given that we now use a custom prelude. Closes #2503.
2015-11-08Org reader: fix markup parsing in headersAlbert Krewinkel1-0/+11
Markup as the very first item in a header wasn't recognized. This was caused by an incorrect parser state: positions at which inline markup can start need to be marked explicitly by changing the parser state. This wasn't done for headers. The proper function to update the state is now called at the beginning of the header parser, fixing this issue. This fixes #2504.
2015-10-25Merge pull request #2477 from tarleb/org-toggling-header-argsJohn MacFarlane1-0/+19
Org reader: allow toggling header args
2015-10-25Org reader: allow toggling header argsAlbert Krewinkel1-0/+19
Org-mode allows to skip the argument of a code block header argument if it's toggling a value. Argument-less headers are now recognized, avoiding weird parsing errors. The fixes are not exactly pretty, but neither is the code that was fixed. So I guess it's about par for the course. However, a rewrite of the header parsing code wouldn't hurt in the long run. Thanks to @jo-tham for filing the bug report. This fixes #2269.
2015-10-24Org reader: fix paragraph/list interactionAlbert Krewinkel1-0/+8
Paragraphs can be followed by lists, even if there is no blank line between the two blocks. However, this should only be true if the paragraph is not within a list, were the preceding block should be parsed as a plain instead of paragraph (to allow for compact lists). Thanks to @rgaiacs for bringing this up. This fixes #2464.
2015-10-14Use custom Prelude to avoid compiler warnings.John MacFarlane1-1/+0
- The (non-exported) prelude is in prelude/Prelude.hs. - It exports Monoid and Applicative, like base 4.8 prelude, but works with older base versions. - It exports (<>) for mappend. - It hides 'catch' on older base versions. This allows us to remove many imports of Data.Monoid and Control.Applicative, and remove Text.Pandoc.Compat.Monoid. It should allow us to use -Wall again for ghc 7.10.
2015-09-19Make sure verse blocks can contain empty linesAlbert Krewinkel1-0/+9
The previous verse parsing code made the faulty assumption that empty strings are valid (and empty) inlines. This isn't the case, so lines are changed to contain at least a newline. It would generally be nicer and faster to keep the newlines while splitting the string. However, this would require more code, which seems unjustified for a simple (and fairly rare) block as *verse*. This fixes #2402.
2015-08-15Org reader: add auto identifiers if not present on headersJuliusz Gonera1-20/+38
Refs #2354 This should also fix the table of contents (--toc) when generating a html file from org input
2015-05-23Org reader: drop trees with a :noexport: tagAlbert Krewinkel1-0/+7
Trees having a `:noexport:` tag set are not exported. This mirrors default Emacs Org-Mode behavior.
2015-05-23Org reader: put header tags into empty spansAlbert Krewinkel1-4/+19
Org mode allows headers to be tagged: ``` org-mode * Headline :TAG1:TAG2: ``` Instead of being interpreted as part of the headline, the tags are now put into the attributes of empty spans. Spans without textual content won't be visible by default, but they are detectable by filters. They can also be styled using CSS when written as HTML. This fixes #2160.
2015-03-28Merge branch 'master' of https://github.com/rootzlevel/pandoc into ↵John MacFarlane1-0/+4
rootzlevel-master Conflicts: src/Text/Pandoc/Readers/Org.hs
2015-03-28Merge branch 'errortype' of https://github.com/mpickering/pandoc into ↵John MacFarlane1-2/+3
mpickering-errortype Conflicts: benchmark/benchmark-pandoc.hs src/Text/Pandoc/Readers/Markdown.hs src/Text/Pandoc/Readers/Org.hs src/Text/Pandoc/Readers/RST.hs tests/Tests/Readers/LaTeX.hs
2015-03-09Org reader: add support for smart punctuationCraig S. Bosma1-0/+24
2015-02-26Org reader: Add test for image linksHans-Peter Deifel1-0/+4
Tests for image links with non-image targets, as introduced in commit 2ca5101.
2015-02-18Update testsMatthew Pickering1-1/+2
2014-12-14Org reader: properly handle links to `file:target`Albert Krewinkel1-1/+8
Org links like `[[file:target][title]]` were not handled correctly, parsing the link target verbatim. The org reader is changed such that the leading `file:` is dropped from the link target. This is related to issues #756 and #1812.