aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Markdown.hs
AgeCommit message (Collapse)AuthorFilesLines
2017-03-05Added readerAbbreviations to ParserState.John MacFarlane1-25/+16
Markdown reader now consults this to determine what is an abbreviation. Eventually it will be possible to specify a custom list (see #256).
2017-03-05Markdown reader: Fixed regression on left-biased union for metadata.John MacFarlane1-6/+9
When multiple YAML metadata blocks are used, and two define the same field, the value defined first takes precedence, according to the manual. This was changed briefly in ba3ee62323644134f2a5dd3277e3349d3681111a. This commit reverts to the original behavior and adds a test case.
2017-03-05Parse YAML metadata in a context that sees footnotes...John MacFarlane1-84/+83
defined in the body of the document. Closes #1279.
2017-03-04Markdown reader: treat span with class `smallcaps` as SmallCaps.John MacFarlane1-13/+18
This allows users to specify small caps in Markdown this way: [my text]{.smallcaps} See #1592.
2017-03-04Stylish-haskell automatic formatting changes.John MacFarlane1-49/+49
2017-03-02Markdown reader: when splitting pipe table cells, skip tex math.John MacFarlane1-1/+1
You might have a `|` character inside math. (Or for that matter something that the parser might mistake for raw HTML.) See #3481.
2017-02-17Markdown reader: Use logMessage instead of report.John MacFarlane1-5/+7
2017-02-11Use new warnings throughout the code base.John MacFarlane1-14/+11
2017-02-10Added Text.Pandoc.Logging (exported module).John MacFarlane1-0/+1
This now contains the Verbosity definition previously in Options, as well as a new LogMessage datatype that will eventually be used instead of raw strings for warnings. This will enable us, among other things, to provide machine-readable warnings if desired. See #3392.
2017-02-06Removed --parse-raw and readerParseRaw.John MacFarlane1-4/+0
These were confusing. Now we rely on the +raw_tex or +raw_html extension with latex or html input. Thus, instead of --parse-raw -f latex we use -f latex+raw_tex and instead of --parse-raw -f html we use -f html+raw_html
2017-01-27Shared: rename compactify', compactify'DL -> compactify, compactifyDL.John MacFarlane1-4/+4
2017-01-25More logging-related changes.John MacFarlane1-7/+3
Class: * Removed getWarnings, withWarningsToStderr * Added report * Added logOutput to PandocMonad * Make logOutput streaming in PandocIO monad * Properly reverse getLog output Readers: * Replaced use of trace with report DEBUG. TWiki Reader: Put everything inside PandocMonad m. API changes.
2017-01-25Changes to verbosity in writer and reader options.John MacFarlane1-1/+1
API changes: Text.Pandoc.Options: * Added Verbosity. * Added writerVerbosity. * Added readerVerbosity. * Removed writerVerbose. * Removed readerTrace. pandoc CLI: The `--trace` option sets verbosity to DEBUG; the `--quiet` option sets it to ERROR, and the `--verbose` option sets it to INFO. The default is WARNING.
2017-01-25Removed readerSmart and the --smart option; added Ext_smart extension.John MacFarlane1-3/+3
Now you will need to do -f markdown+smart instead of -f markdown --smart This change opens the way for writers, in addition to readers, to be sensitive to +smart, but this change hasn't yet been made. API change. Command-line option change. Updated manual.
2017-01-25Make Extensions a custom type instead of a Set Extension.John MacFarlane1-9/+9
The type is implemented in terms of an underlying bitset which should be more efficient. API change: from Text.Pandoc.Extensions export Extensions, emptyExtensions, extensionsFromList, enableExtension, disableExtension, extensionEnabled.
2017-01-25Markdown reader: Removed readMarkdownWithWarnings [API change].John MacFarlane1-10/+1
2017-01-25Have warningWithPos take a SourcePos rather than Maybe SourcePos.John MacFarlane1-5/+5
After all, we have warning if you don't want the source pos info.
2017-01-25Class: rename addWarning[WithPos] to warning[WithPos].John MacFarlane1-5/+5
There's already a function addWarning in Parsing! Maybe we can dispense with that now, but I still like 'warning' better as a name.
2017-01-25Readers: pass errors straight up to PandocMonad.Jesse Rosenthal1-2/+1
Since we've unified error types, we can just throw the same error at the toplevel.
2017-01-25Unify Errors.Jesse Rosenthal1-1/+2
2017-01-25Working on readers.Jesse Rosenthal1-221/+257
2017-01-08Fixed -f markdown_github-hard_line_breaks+escaped_line_breaks.John MacFarlane1-0/+1
Previously this did not properly enable escaped line breaks. Closes #3341.
2016-12-24markdown reader: disallow space between inline code and attributes (#3326)Mauro Bieg1-2/+2
closes #3323
2016-11-16Small caps in Bracketed Spans (#3191)ickc1-1/+7
* Markdown reader: modify bracketedSpan to check small caps * MANUAL.txt: add description on the use of `bracketed_spans` in small cap * Improve markdown readers: bracketedSpan function EXACTLY as spanHtml
2016-11-15Allow alignments to be specified in Markdown grid tables.John MacFarlane1-17/+23
2016-11-05Markdown reader: Allow reference link labels starting with @...John MacFarlane1-1/+2
...if citations extension disabled. Example: in [link text][@a] [@a]: url `link text` isn't hyperlinked because `[@a]` is parsed as a citation. Previously this happened whether or not the `citations` extension was enabled. Now it happens only if the `citations` extension is enabled. Closes #3209.
2016-10-26Markdown Reader: add attributes for autolink (#3183)Daniele D'Orazio1-1/+3
2016-10-22Added `angle_brackets_escapable` extension.John MacFarlane1-0/+2
This is needed because github flavored Markdown has a slightly different set of escapable symbols than original Markdown; it includes angle brackets. Closes #2846.
2016-10-13Parse line-oriented markup as LineBlockAlbert Krewinkel1-2/+2
Markup-features focusing on lines as distinctive part of the markup are read into `LineBlock` elements. This currently means line blocks in reStructuredText and Markdown (the latter only if the `line_block` extension is enabled), the `linegroup`/`line` combination from the Docbook 5.1 working draft, and Org-mode `VERSE` blocks.
2016-09-28Markdown reader: added bracket syntax for native spans.John MacFarlane1-0/+8
See #168. Text.Pandoc.Options.Extension has a new constructor `Ext_brackted_spans`, which is enabled by default in pandoc's Markdown.
2016-09-02Remove Compat.MonoidJesse Rosenthal1-1/+1
This was only necessary for GHC versions with base below 4.5 (i.e., ghc < 7.4).
2016-04-10Markdown reader: Fix pandoc title blocks with lines ending in 2 spaces.John MacFarlane1-19/+23
Closes #2799. Also added -s to markdown-reader-more test.
2016-03-09Markdown reader: Improved pipe table parsing.John MacFarlane1-15/+15
Fixes #2765. Added test case.
2016-03-09Markdown reader: Clean up pipe table parsing.John MacFarlane1-8/+8
2016-03-09Markdown reader: allow `+` separators in pipe table cells.John MacFarlane1-6/+4
We already allowed them in the header, but not in the body rows, for some reason. This gives compatibility with org-mode tables.
2016-03-09Markdown reader: don't cross line boundary parsing pipe table row.John MacFarlane1-1/+7
Previously an emph element could be parsed across the newline at the end of the pipe table row. I thought this would help with #2765, but it doesn't.
2016-02-21Markdown reader: use htmlInBalanced for rawVerbatimBlock.John MacFarlane1-7/+5
This should give better performance. See #2730.
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-01-07Markdown reader: renormalize table column widths if they exceed 100%.John MacFarlane1-1/+6
Closes #2626.
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-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-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-11-24Allow pipe tables with no body rows.John MacFarlane1-2/+3
Previously this raised a runtime error. Closes #2556.
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 MacFarlane1-26/+31
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-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-09Restored Text.Pandoc.Compat.Monoid.John MacFarlane1-0/+1
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 MacFarlane1-1/+0
This reverts commit c423dbb5a34c2d1195020e0f0ca3aae883d0749b.