aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
AgeCommit message (Collapse)AuthorFilesLines
2016-11-15Allow alignments to be specified in Markdown grid tables.John MacFarlane2-26/+52
2016-11-15Markdown writer: fixed inconsistent spacing issue.John MacFarlane1-12/+20
Previously a tight bullet sublist got rendered with a blank line after, while a tight ordered sublist did not. Now we don't get the blank line in either case. Closes #3232.
2016-11-13HTML reader: only treat "a" element as link if it has href.John MacFarlane1-7/+19
Otherwise treat as span. Closes #3226.
2016-11-12Use correct mime types for woff and woff2.John MacFarlane1-2/+2
Closes #3228.
2016-11-12Markdown writer: Fix escaping of spaces in super/subscript.John MacFarlane1-37/+39
Previously two backslashes were inserted, which gave a literal backslash. Closes #3225.
2016-11-10Docx reader: add a placeholder value for CHART.Jesse Rosenthal2-0/+17
We wrap `[CHART]` in a `<span class="chart">`. Note that it maps to inlines because, in docx, anything in a drawing tag can be part of a larger paragraph.
2016-11-10Docx reader: Be more specific in parsing imagesJesse Rosenthal1-6/+10
We not only want "w:drawing", because that could also include charts. Now we specify "w:drawing"//"pic:pic". This shouldn't change behavior at all, but it's a first step toward allowing other sorts of drawing data as well.
2016-11-09Org reader: allow HTML attribs on non-figure imagesAlbert Krewinkel1-6/+8
Images which are the only element in a paragraph can still be given HTML attributes, even if the image does not have a caption and is hence not a figure. The following will add set the `width` attribute of the image to `50%`: #+ATTR_HTML: :width 50% [[file:image.jpg]] Closes: #3222
2016-11-08Inline code when text has a special styleHubert Plociniczak2-7/+22
When a piece of text has a text 'Source_Text' then we assume that this is a piece of the document that represents a code that needs to be inlined. Addapted an odt writer to also reflect that change; previously it was just writing a 'preformatted' text using a non-distinguishable font style. Code blocks are still not recognized by the ODT reader. That's a separate issue.
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-11-02Docx Reader: abstract out function to avoid code repetition.Jesse Rosenthal1-16/+14
2016-11-02Docx writer: Handle title text in images.Jesse Rosenthal1-2/+2
We already handled alt text. This just puts the image "title" into the docx "title" attr.
2016-11-02Docx reader: Handle Alt text and titles in images.Jesse Rosenthal2-11/+28
We use the "description" field as alt text and the "title" field as title. These can be accessed through the "Format Picture" dialog in Word.
2016-11-02Docx reader utils: handle empty namespace in elemNameJesse Rosenthal1-1/+2
Previously, if given an empty namespace: (elemName ns "" "foo") `elemName` would output a QName with a `Just ""` namespace. This is never what we want. Now we output a `Nothing`. If someone *does* want a `Just ""` in the namespace, they can enter the QName value explicitly.
2016-11-02HTML reader: treat `<math>` as MathML by default...John MacFarlane1-8/+11
unless something else is explicitly specified in xmlns. Provided it parses as MathML, of course. Also fixed default which should be to inline math if no display attribute is used.
2016-11-02LaTeX reader: Handle BVerbatim from fancyvrb. Fixes #3203.John MacFarlane1-10/+15
2016-11-01Handle hungarumlaut in LaTeX reader. Closes #3201.John MacFarlane1-0/+16
2016-11-01[odt] Infer tables' header props from rows (#3199)hubertp-lshift1-2/+9
ODT reader simply provided an empty header list which meant that the contents of the whole table, even if not empty, was simply ignored. While we still do not infer headers we at least have to provide default properties of columns.
2016-10-31LaTeX reader: allow for []s inside LaTeX optional args.John MacFarlane1-1/+2
Fixes cases like: \begin{center} \begin{tikzpicture}[baseline={([yshift=+-.5ex]current bounding box.center)}, level distance=24pt] \Tree [.{S} [.NP John\index{i} ] [.VP [.V likes ] [.NP himself\index{i,*j} ]]] \end{tikzpicture} \end{center}
2016-10-30Org reader: support `ATTR_HTML` for special blocksAlbert Krewinkel1-9/+22
Special blocks (i.e. blocks with unrecognized names) can be prefixed with an `ATTR_HTML` block attribute. The attributes defined in that meta-directive are added to the `Div` which is used to represent the special block. Closes: #3182
2016-10-30Org reader: support the `todo` export optionAlbert Krewinkel3-2/+7
The `todo` export option allows to toggle the inclusion of TODO keywords in the output. Setting this to `nil` causes TODO keywords to be dropped from headlines. The default is to include the keywords.
2016-10-30Org reader: add support for todo-markersAlbert Krewinkel3-5/+98
Headlines can have optional todo-markers which can be controlled via the `#+TODO`, `#+SEQ_TODO`, or `#+TYP_TODO` meta directive. Multiple such directives can be given, each adding a new set of recognized todo-markers. If no custom todo-markers are defined, the default `TODO` and `DONE` markers are used. Todo-markers are conceptually separate from headline text and are hence excluded when autogenerating headline IDs. The markers are rendered as spans and labelled with two classes: One class is the markers name, the other signals the todo-state of the marker (either `todo` or `done`).
2016-10-26Markdown Reader: add attributes for autolink (#3183)Daniele D'Orazio1-1/+3
2016-10-25reveal.js: don't change slide title to level 1 header.John MacFarlane1-3/+1
This also affects other HTML slide show formats. Closes #2221.
2016-10-24Export Text.Pandoc.Error in Text.Pandoc.John MacFarlane1-3/+2
[API change]
2016-10-23Tighten up parsing of raw email addresses.John MacFarlane1-4/+13
Technically `**@user` is a valid email address, but if we allow things like this, we get bad results in markdown flavors that autolink raw email addresses. (See #2940.) So we exclude a few valid email addresses in order to avoid these more common bad cases. Closes #2940.
2016-10-23ICML writer: replace partial function (!!) in table handling (#3175)Mauro Bieg1-5/+5
2016-10-22Added `angle_brackets_escapable` extension.John MacFarlane2-1/+5
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-22EPUB reader: don't add root path to data: URIs.John MacFarlane1-1/+3
Closes #3150. Thanks to @lep for the bug report and patch.
2016-10-19Merge pull request #3108 from tarleb/partJohn MacFarlane5-40/+68
Add command line option allowing to set type of top-level divisions
2016-10-19Add option for top-level division typeAlbert Krewinkel5-48/+71
The `--chapters` option is replaced with `--top-level-division` which allows users to specify the type as which top-level headers should be output. Possible values are `section` (the default), `chapter`, or `part`. The formats LaTeX, ConTeXt, and Docbook allow `part` as top-level division, TEI only allows to set the `type` attribute on `div` containers. The writers are altered to respect this option in a sensible way.
2016-10-19Image with a caption needs special formattingHubert Plociniczak1-2/+6
Latex Writer only handles captions if the image's title is prefixed with 'fig:'.
2016-10-18Merge pull request #3166 from hubertp-lshift/bug/3134John MacFarlane1-3/+2
Issue 3143: Don't duplicate text for anchors
2016-10-18Merge pull request #3165 from hubertp-lshift/feature/odt-imageJohn MacFarlane4-38/+151
[odt] images parser
2016-10-18Better fix for the problem with ghc 7.8.John MacFarlane1-1/+3
2016-10-18Try to fix build error on ghc 7.8.John MacFarlane1-1/+1
@tarleb this is an interesting one, see the build log in https://travis-ci.org/jgm/pandoc/jobs/168612017 It only failed on ghc 7.8; I think this must have to do with the change making Monad a superclass of Applicative, hence this change.
2016-10-18Issue 3143: Don't duplicate text for anchorsHubert Plociniczak1-3/+2
When creating an anchor element we were adding its representation as well as the original content, leading to text duplication.
2016-10-17Org writer: drop space before footnote markersAlbert Krewinkel1-1/+1
The writer no longer adds an extra space before footnote markers. Fixes: #3162
2016-10-17Use bind function instead of pattern matchingHubert Plociniczak1-4/+1
2016-10-17Minor refactoringHubert Plociniczak1-10/+6
2016-10-17Infer caption from the text following the imgHubert Plociniczak1-20/+47
Frame can contain other frames with the text boxes. This is something that has not been considered before and meant that the whole construction of images was broken in those cases. Also the captions were fixed/ignored.
2016-10-17RST reader: skip whitespace before note.Jesse Rosenthal1-2/+3
RST requires a space before a footnote marker. We discard those spaces so that footnotes will be adjacent to the text that comes before it. This is in line with what rst2latex does. rst2html does not discard the space, but its html output is different than pandoc's, so this seems the most semantically correct approach. Closes #3163
2016-10-14Org reader: allow figure with empty captionAlbert Krewinkel1-3/+1
A `#+CAPTION` attribute before an image is enough to turn an image into a figure. This wasn't the case because the `parseFromString` function, which processes the caption value, would fail on empty values. Adding a newline character to the caption value fixes this. Fixes: #3161
2016-10-14Merge pull request #3146 from hubertp-lshift/feature/odt-list-start-valueJohn MacFarlane2-13/+21
[ODT Parser] Include list's starting value
2016-10-14Added tests and a corner case for starting numberHubert Plociniczak1-0/+1
Review revealed that we didn't handle the case when the starting point is an empty string. While this is not a valid .odt file, we simply added a special case to deal with it. Also added tests for the new feature.
2016-10-13Markdown writer: Abstract out note/ref function.Jesse Rosenthal1-28/+22
We do basically the same thing every time we insert notes, so let's cut down on code duplication.
2016-10-13Allow http-client 0.4.30, which is the version in stackage lts.John MacFarlane1-16/+0
Previously we required 0.5. Remove CPP conditionals for earlier versions.
2016-10-13Revert "Remove http-client CPP conditionals."John MacFarlane1-1/+10
This reverts commit 3f82471355286d33f2d73329c29a51c47bf76ad7. We might want to revert the requirement of http-client 0.5, as this is not yet in Stackage and that is starting to cause problems. I can't recall why it is there.
2016-10-13Allow empty lines when parsing line blocksAlbert Krewinkel1-2/+5
Line blocks are allowed to contain empty lines and should be parsed as a single block in that case. Previously an empty (line block) line would have terminated parsing of the line block element.
2016-10-13Parse line-oriented markup as LineBlockAlbert Krewinkel4-9/+9
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.