summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
Commit message (Collapse)AuthorAge
* Docx writer: set paragraph to FirstPara after display mathJesse Rosenthal2016-07-01
| | | | | | | We treat display math like block quotes, and apply FirstParagraph style to paragraphs that follow them. These can be styled as the user wishes. (But, when the user is using indentation, this allows for paragraphs to continue after display math without indentation.)
* Writers: treat SoftBreak as space for strippingJesse Rosenthal2016-07-01
| | | | | | In Writers.Shared, we strip leading and trailing spaces for display math. Since SoftBreak's are treated as spaces, we should strip those too.
* LaTeX reader: fixed `\cite` so it is a NormalCitation not AuthorInText.John MacFarlane2016-06-29
|
* Merge pull request #3001 from tarleb/org-figure-labelJohn MacFarlane2016-06-26
|\ | | | | Org reader: support figure labels
| * Org reader: support figure labelsAlbert Krewinkel2016-06-26
| | | | | | | | | | | | | | | | 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.
* | Textile reader: Fix overly aggressive interpretation as images.John MacFarlane2016-06-25
| | | | | | | | | | | | Spaces are not allowed in the image URL in textile. Closes #2998.
* | Fixed RST links with no explicit link text.John MacFarlane2016-06-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Make --webtex work with the Markdown writer.John MacFarlane2016-06-24
|/ | | | | Closes #1177. This is a convenient option for people using websites whose Markdown flavors don't provide for math.
* Textile reader: fixed attributes.John MacFarlane2016-06-23
| | | | | | | | | | | | | | Attributes can't be followed by a space. So, _(class)emph_ but _(noclass) emph_ Closes #2984.
* Markdown writer: use raw HTML for simple, pipe tables with linebreaks.John MacFarlane2016-06-23
| | | | | | | Markdown line breaks involve a newline, and simple and pipe tables can't contain one. Closes #2993.
* Docx reader: Add warning for advanced comment formatting.Jesse Rosenthal2016-06-23
| | | | | | 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.
* docx reader: enable warnings in top-level readerJesse Rosenthal2016-06-23
| | | | | Previously we had only allowed for warnings in the parser. Now we allow for them in the `Docx.hs` as well. The warnings are simply concatenated.
* Docx reader: add simple comment functionality.Jesse Rosenthal2016-06-23
| | | | | | | | | | | | | This adds simple track-changes comment parsing to the docx reader. It is turned on with `--track-changes=all`. All comments are converted to inlines, which can list some information. In the future a warning will be added for comments with formatting that seems like it will be excessively denatured. Note that comments can extend across blocks. For that reason there are two spans: `comment-start` and `comment-end`. `comment-start` will contain the comment. `comment-end` will always be empty. The two will be associated by a numeric id.
* Shared: Add BlockQuote to blocksToInlinesJesse Rosenthal2016-06-23
|
* Shared: introduce blocksToInlines functionJesse Rosenthal2016-06-23
| | | | | | | | | | This is a lossy function for converting `[Block] -> [Inline]`. Its main use, at the moment, is for docx comments, which can contain arbitrary blocks (except for footnotes), but which will be converted to spans. This is, at the moment, pretty useless for everything but the basic `Para` and `Plain` comments. It can be improved, but the docx reader should probably emit a warning if the comment contains more than this.
* Merge pull request #2992 from tarleb/org-partial-functionsJohn MacFarlane2016-06-22
|\ | | | | Org reader: remove partial functions
| * Org reader: remove partial functionsAlbert Krewinkel2016-06-21
| | | | | | | | | | | | | | Partial functions like `head` lead to avoidable errors and should be avoided. They are replaced with total functions. This fixes #2991.
* | HTML writer: Better support for raw LaTeX environments.John MacFarlane2016-06-22
|/ | | | | | | | | | | | Previously we just passed all raw TeX through when MathJax was used for HTML math. This passed through too much. With this patch, only raw LaTeX environments that MathJax can handle get passed through. This patch also causes raw LaTeX environments to be treated as math, when possible, with MathML and WebTeX output. Closes #2758.
* Changed email-obfuscation default to no obfuscation.John MacFarlane2016-06-20
| | | | | | | | | - `writerEmailObfuscation` in `defaultWriterOptions` is now `NoObfuscation` - the default for the command-line `--email-obfuscation` option is now `none`. Closes #2988.
* Org reader: support arbitrary raw inlinesAlbert Krewinkel2016-06-13
| | | | | | | 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.
* Org writer: support arbitrary raw inlinesAlbert Krewinkel2016-06-13
| | | | | | | 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 writer.
* Docbook writer: Declare xlink namespace in Docbook5 outputIvo Clarysse2016-06-07
|
* Org reader: add support for "Berkeley-style" citesAlbert Krewinkel2016-06-05
| | | | | | | | | 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.
* Org reader: add semicolon to list of special charsAlbert Krewinkel2016-06-05
| | | | | | | | | | Semicolons are used as special characters in citations syntax. This ensures the correct parsing of Pandoc-style citations: [prefix; @key; suffix] Previously, parsing would have failed unless there was a space or other special character as the last <prefix> character.
* Org reader: support special strings export optionAlbert Krewinkel2016-06-03
| | | | | Parsing of special strings (like '...' as ellipsis or '--' as en dash) can be toggled using the `-` option.
* Org reader: support emphasized text export optionAlbert Krewinkel2016-06-03
| | | | | | | Parsing of emphasized text can be toggled using the `*` option. This influences parsing of text marked as emphasized, strong, strikeout, and underline. Parsing of inline math, code, and verbatim text is not affected by this option.
* Org reader: support smart quotes export optionAlbert Krewinkel2016-06-03
| | | | Reading of smart quotes can be toggled using the `'` option.
* Org reader: drop unused field from parser stateAlbert Krewinkel2016-06-02
| | | | | | | | | The `OrgParserState` contained both an `orgStateMeta` and `orgStateMeta'` field, the former for plain meta information and the latter for F-monad wrapped meta info. The plain meta info is only used to make `OrgParserState` an instance of the `HasMeta` class, which in turn is never used in the reader. The (F Meta) version is hence renamed to the "un-primed" version while the other one is dropped.
* Org reader: undo code duplicationAlbert Krewinkel2016-06-02
| | | | | | | | Some code was duplicated (copy-pasted) or placed in an inappropriate module during the modularization refactoring. Those functions are moved into a `Shared` module, as was originally intended but forgotten. Better documentation of the respective functions is a positive side-effect.
* Merge pull request #2950 from tarleb/org-ref-supportJohn MacFarlane2016-05-31
|\ | | | | Org reader: support org-ref style citations
| * Org reader: support org-ref style citationsAlbert Krewinkel2016-05-27
| | | | | | | | | | | | 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.
* | Merge pull request #2954 from tarleb/org-export-blocksJohn MacFarlane2016-05-31
|\ \ | | | | | | Org export blocks
| * | Org reader: support new syntax for export blocksAlbert Krewinkel2016-05-29
| | | | | | | | | | | | | | | | | | | | | 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.
| * | Org reader: refactor BEGIN…END block parsingAlbert Krewinkel2016-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Reorder functions, grouping related functions together. - Demote simple functions to local functions if they are used just once. - Rename and document functions to increase code readability. - Fix handling of whitespace in blocks, allowing content to be indented less then the block header.
| * | Org reader: rename `parseInlines` to `inlines`Albert Krewinkel2016-05-29
| |/ | | | | | | | | | | Having a function starting with `parse` in a parsing library is overly redundant. Let's use a nicer, shorter name more in line with the rest of the library.
* / brazilian -> brazil for polyglossia.John MacFarlane2016-05-31
|/ | | | Closes #2953.
* Org reader: extract blocks parser to moduleAlbert Krewinkel2016-05-25
| | | | | | Block parsing code is moved to a separate module. This is part of the Org-mode reader cleanup effort.
* Org reader: extract inline parser to moduleAlbert Krewinkel2016-05-25
| | | | | | | Inline parsing code is moved to a separate module. Parsers for block starts are extracted as well, as those are used in the `endline` parser. This is part of the Org-mode reader cleanup effort.
* Org reader: extract parsing function to moduleAlbert Krewinkel2016-05-25
| | | | | | | | | | | | The Org-mode reader uses many functions defined in the `Text.Pandoc.Parsing` utility module. Some of the functions are overwritten with versions adapted to Org-mode idiosyncrasies. These special functions, as well as the normal Pandoc versions, are combined in a single module to increase the ease of use. This leads to decoupling of Org-mode and Pandoc and hence to slightly cleaner code. The downside is code-bloat due to repeated import/export statements.
* EPUB Reader: normalise Link id as wellmb212016-05-24
|
* Org writer: add drawer capabilityCarlos Sosa2016-05-23
| | | | | | | | | | | | For the implementation of the Drawer element in the Org Writer, we make use of a generic Block container with attributes. The presence of a `drawer` class defines that the `Div` constructor is a drawer. The first class defines the drawer name to use. The key-value list in the attributes defines the keys to add inside the Drawer. Lastly, the list of Block elements contains miscellaneous blocks elements to add inside of the Drawer. Signed-off-by: Albert Krewinkel <albert@zeitkraut.de>
* Org reader: respect drawer export settingAlbert Krewinkel2016-05-23
| | | | | 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.
* Org reader/writer: use CUSTOM_ID in propertiesAlbert Krewinkel2016-05-22
| | | | | | | | | 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.
* HTML reader: fixed bug in pClose.John MacFarlane2016-05-21
| | | | | This caused exponential parsing behavior in documnets with unclosed tags in dl, dd, dt.
* Org writer: add :PROPERTIES: drawer supportAlbert Krewinkel2016-05-20
| | | | | | | | | This allows header attributes to be added to org documents in the form of `:PROPERTIES:` drawers. All available attributes are stored as key/value pairs. This reflects the way the org reader handles `:PROPERTIES:` blocks. This closes #1962.
* Org reader: add :PROPERTIES: drawer supportAlbert Krewinkel2016-05-20
| | | | | | | | | | | | | | 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.
* Merge pull request #2927 from tarleb/org-attr-htmlJohn MacFarlane2016-05-19
|\ | | | | Org reader support for ATTR_HTML statements
| * Org reader: add support for ATTR_HTML attributesAlbert Krewinkel2016-05-19
| | | | | | | | | | | | | | | | | | | | | | 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.
| * Org reader: use custom `anyLine`Albert Krewinkel2016-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | Additional state changes need to be made after a newline is parsed, otherwise markup may not be recognized correctly. This fixes a bug where markup after certain block-types would not be recognized. E.g. `/emph/` in the following snippet was not parsed as emphasized. foo # comment /emph/
| * Org reader: refactor block attribute handlingAlbert Krewinkel2016-05-19
| | | | | | | | | | | | | | A parser state attribute was used to keep track of block attributes defined in meta-lines. Global state is undesirable, so block attributes are no longer saved as part of the parser state. Old functions and the respective part of the parser state are removed.