aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
AgeCommit message (Collapse)AuthorFilesLines
2016-02-20HTML reader: rewrote htmlInBalanced.John MacFarlane1-10/+39
This version avoids an exponential performance problem with `<script>` tags, and it should be faster in general. Closes #2730.
2016-02-16HTML reader: properly handle an empty cell in a simple table.John MacFarlane1-0/+1
Closes #2718.
2016-02-04Markdown reader: Fixed bug with smart quotes around tex math.John MacFarlane1-2/+2
Previously smart quotes were incorrect in the following: '$\neg(x \in x)$'. (because of the following period). This commit fixes the problem, which was introduced by commit 4229cf2d92faf5774fe1a3a9c89a5de885cf75cd.
2016-02-02Docx reader: Add a "Link" modifier to ReducibleJesse Rosenthal1-0/+2
We want to make sure that links have their spaces removed, and are appropriately smushed together. This closes #2689
2016-01-31Org reader: Refactor link-target processingAlbert Krewinkel1-29/+29
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-31LaTeX reader: `inlineCommand` now gobbles an empty `{}` after any command.John MacFarlane1-1/+2
This gives better results when people write e.g. `\TeX{}` in Markdown. \TeX{} and \LaTeX{} now works as expected with `pandoc -f markdown -t latex`. Closes #2687.
2016-01-29HTML reader: handle multiple meta tags with same name.John MacFarlane1-2/+6
Put them in a list in the metadata so they are all preserved, rather than (as before) throwing out all but one..
2016-01-29Properly handle LaTeX "math" environment as inline math.John MacFarlane1-0/+1
See #2171.
2016-01-25Textile reader: Support `>`, `<`, `=`, `<>` text alignment attributes.John MacFarlane1-2/+19
Closes #2674.
2016-01-22Changed type of Shared.uniqueIdent argument from [String] to Set String.John MacFarlane5-11/+15
This avoids performance problems in documents with many identically named headers. Closes #2671.
2016-01-11Prefix even empty figure names with "fig:"Albert Krewinkel1-3/+3
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-11Depend on deepseq rather than deepseq-generics.John MacFarlane1-1/+1
See fpco/stackage#1096.
2016-01-11Fixed regression in latex smart quote parsing.John MacFarlane1-4/+5
Closes #2645. In cases where a match was not found for a quote, everything from the open quote to the end of the paragraph was being dropped.
2016-01-07Merge pull request #2629 from tarleb/org-noexport-fixJohn MacFarlane1-2/+4
Fix function dropping subtrees tagged :noexport:
2016-01-07Fix function dropping subtrees tagged :noexport:Albert Krewinkel1-2/+4
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.
2016-01-07Markdown reader: renormalize table column widths if they exceed 100%.John MacFarlane1-1/+6
Closes #2626.
2016-01-02Textile reader: don't allow block HTML tags in inline contexts.John MacFarlane1-2/+2
The reader previously did allow this, following redcloth, which happily parses Html blocks can be <div>inlined</div> as well. as <p>Html blocks can be <div>inlined</div> as well.</p> This is invalid HTML, and this kind of thing can lead to parsing problems (stack overflows) as well. So this commit undoes this behavior. The above sample now produces; <p>Html blocks can be</p> <div> <p>inlined</p> </div> <p>as well.</p>
2016-01-02MediaWiki reader: interpret markup inside `<tt>`, `<code>`.John MacFarlane1-4/+6
Closes #2607.
2015-12-29Use cmark 0.5.John MacFarlane1-4/+12
Closes #2605.
2015-12-22LaTeX reader: allow blank space between braced arguments of commands.John MacFarlane1-1/+3
For example \foo {bar} {baz} Closes #2592.
2015-12-19Markdown reader: fixed parsing bug with macros.John MacFarlane1-1/+1
Previously macro definitions in indented code blocks were being parsed as macro definitions, not code.
2015-12-13Docx reader: image attributesmb212-10/+32
2015-12-13new function to extract multiple properties at once in CSS.hsmb211-4/+1
and use it in Textile reader
2015-12-13RST reader: image attributesmb211-7/+14
2015-12-12Implemented `east_asian_line_breaks` extension.John MacFarlane1-1/+15
Text.Pandoc.Options: Added `Ext_east_asian_line_breaks` constructor to `Extension` (API change). This extension is like `ignore_line_breaks`, but smarter -- it only ignores line breaks between two East Asian wide characters. This makes it better suited for writing with a mix of East Asian and non-East Asian scripts. Closes #2586.
2015-12-12Modified readers to emit SoftBreak when appropriate.John MacFarlane7-9/+19
2015-12-11Implemented SoftBreak and new `--wrap` option.John MacFarlane1-1/+1
Added threefold wrapping option. * Command line option: deprecated `--no-wrap`, added `--wrap=[auto|none|preserve]` * Added WrapOption, exported from Text.Pandoc.Options * Changed type of writerWrapText in WriterOptions from Bool to WrapOption. * Modified Text.Pandoc.Shared functions for SoftBreak. * Supported SoftBreak in writers. * Updated tests. * Updated README. Closes #1701.
2015-12-11Markdown reader: parse soft break as SoftBreak.John MacFarlane1-1/+1
2015-12-03Markdown reader: Improved pipe table relative widths.John MacFarlane1-4/+4
Previously pipe table columns got relative widths (based on the header underscore lines) when the source of one of the rows was greater in width than the column width. This gave bad results in some cases where much of the width of the row was due to nonprinting material (e.g. link URLs). Now pandoc only looks at printable width (the width of a plain string version of the source), which should give better results. Thanks to John Muccigrosso for bringing up the issue.
2015-12-03Textile Reader: image attributesmb211-2/+9
closes #2515
2015-11-24Allow pipe tables with no body rows.John MacFarlane1-2/+3
Previously this raised a runtime error. Closes #2556.
2015-11-24LaTeX reader: Improved smart quote parsing.John MacFarlane1-14/+13
This fixes redering of unmatched quotes. Closes #2555.
2015-11-23LaTeX reader: Use curly quotes for unmatched `.John MacFarlane1-1/+8
Partially addresses #2555. Note that there's still a problem with the code sample given.
2015-11-23Docx Reader: Remove DummyListItem typeJesse Rosenthal2-12/+7
Change 5527465c introduced a `DummyListItem` type in Docx/Parse.hs. In retrospect, this seems like it mixes parsing and iterpretation excessively. What's *really* going on is that we have a list item without and associate level or numeric info. We can decide what to do what that in Docx.hs (treat it like a list paragraph), but the parser shouldn't make that decision. This commit makes what is going on a bit more explicit. `LevelInfo` is now a Maybe value in the `ListItem` type. If it's a Nothing, we treat it as a ListParagraph. If it's a Just, it's a normal list item.
2015-11-19Renamed link attribute extensions.John MacFarlane1-4/+4
* Old `link_attributes` -> `mmd_link_attributes` * Recently added `common_link_attributes` -> `link_attributes` Note: this change could break some existing workflows.
2015-11-19Merge branch 'new-image-attributes' of https://github.com/mb21/pandoc into ↵John MacFarlane9-87/+117
mb21-new-image-attributes * Bumped version to 1.16. * Added Attr field to Link and Image. * Added `common_link_attributes` extension. * Updated readers for link attributes. * Updated writers for link attributes. * Updated tests * Updated stack.yaml to build against unreleased versions of pandoc-types and texmath. * Fixed various compiler warnings. Closes #261. TODO: * Relative (percentage) image widths in docx writer. * ODT/OpenDocument writer (untested, same issue about percentage widths). * Update pandoc-citeproc.
2015-11-19Rationalized behavior of --no-tex-ligatures and --smart.John MacFarlane1-9/+15
This change makes `--no-tex-ligatures` affect the LaTeX reader as well as the LaTeX and ConTeXt writers. If it is used, the LaTeX reader will parse characters `` ` ``, `'`, and `-` literally, rather than parsing ligatures for quotation marks and dashes. And the LaTeX writer will print unicode quotation mark and dash characters literally, rather than converting them to the standard ASCII ligatures. Note that `--smart` has no affect on the LaTeX reader. `--smart` is still the default for all input formats when LaTeX or ConTeXt is the output format, *unless* `--no-tex-ligatures` is used. Some examples to illustrate the logic: ``` % echo "'hi'" | pandoc -t latex `hi' % echo "'hi'" | pandoc -t latex --no-tex-ligatures 'hi' % echo "'hi'" | pandoc -t latex --no-tex-ligatures --smart ‘hi’ % echo "'hi'" | pandoc -f latex --no-tex-ligatures <p>'hi'</p> % echo "'hi'" | pandoc -f latex <p>’hi’</p> ``` Closes #2541.
2015-11-18Docx reader: Clean up commented-out functionJesse Rosenthal1-7/+0
A residue of a recent change was left around in the form of a commented-out function. Let's clean that up.
2015-11-18Docx reader: Handle dummy list items.Jesse Rosenthal2-6/+15
These come up when people create a list item and then delete the bullet. It doesn't refer to any real list item, and we used to ignore it. We handle it with a DummyListItem type, which, in Docx.hs, is turned into a normal paragraph with a "ListParagraph" class. If it follow another list item, it is folded as another paragraph into that item. If it doesn't, it's just its own (usually indented, and therefore block-quoted) paragraph.
2015-11-16Textile reader: skip over attribute in image source.John MacFarlane1-0/+1
We don't have a place yet for styles or sizes on images, but we can skip the attributes rather than incorrectly taking them to be part of the filename. Closes #2515.
2015-11-14Follow relationships correctly in foot/endnotes.Jesse Rosenthal1-27/+40
There are separate relationship (link) files for foot and endnotes. These had previously been grouped together which led to links not working correctly in notes. This should finally fix that.
2015-11-13Merge pull request #2526 from tarleb/org-definition-lists-fixJohn MacFarlane1-1/+4
Org reader: Require whitespace around def list markers
2015-11-13Org reader: Require whitespace around def list markersAlbert Krewinkel1-1/+4
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-13Merge pull request #2525 from tarleb/org-smart-fixesJohn MacFarlane1-4/+9
Org reader: Fix emphasis rules for smart parsing
2015-11-13Added `emoji` extension to Markdown.John MacFarlane1-0/+17
This is enabled by default in `markdown_github`. Added `Ext_emoji` to `Extension` in `Text.Pandoc.Options` (API change). Closes #2523.
2015-11-13Org reader: Fix emphasis rules for smart parsingAlbert Krewinkel1-4/+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-09Restored Text.Pandoc.Compat.Monoid.John MacFarlane12-4/+12
Don't use custom prelude for latest ghc. This is a better approach to making 'stack ghci' and 'cabal repl' work. Instead of using NoImplicitPrelude, we only use the custom prelude for older ghc versions. The custom prelude presents a uniform API that matches the current base version's prelude. So, when developing (presumably with latest ghc), we don't use a custom prelude at all and hence have no trouble with ghci. The custom prelude no longer exports (<>): we now want to match the base 4.8 prelude behavior.
2015-11-09Revert "Use -XNoImplicitPrelude and 'import Prelude' explicitly."John MacFarlane33-34/+1
This reverts commit c423dbb5a34c2d1195020e0f0ca3aae883d0749b.
2015-11-08Merge pull request #2502 from minoki/latex-comment-environmentJohn MacFarlane1-1/+2
LaTeX reader: Handle `comment` environment.
2015-11-08Merge pull request #2505 from tarleb/org-header-markup-fixJohn MacFarlane1-1/+1
Org reader: fix markup parsing in headers