Commit graph

6430 commits

Author SHA1 Message Date
chinapedia
cfb3726216 MediaWiki reader: handle multiple attributes in table row (#5471) 2019-05-01 20:21:15 -04:00
John MacFarlane
a20323033e Fix footnote in image caption.
Regression!  The fix for #4683 broke this case.
2019-05-01 16:56:37 -07:00
John MacFarlane
f11d0c9dc8 HTML: prevent gratuitious emojification on iOS.
iOS chooses to render a number of Unicode entities,
including '↩', as big colorful emoji.  This can be
defeated by appending Unicode
VARIATION SELECTOR-15'/'VARIATION SELECTOR-16'.
So we now append this character when escaping
strings, for both '↩' and '↔'.

If other characters prove problematic, they can
simply be added to needsVariationSelector.

Closes #5469.
2019-04-30 22:32:52 -07:00
John MacFarlane
66dd2008b0 Fix --self-contained so it works when output format has extensions.
Previously if you used `--self-contained` with `html-smart` or
`html+smart`, it wouldn't work.
2019-04-25 21:56:26 -04:00
John MacFarlane
d88a601642 Allow use of -output-directory in --pdf-engine-opt.
This is currently possible with `mklatex` and `-outdir`, but
was not yet possible with xelatex and `-output-directory`.
Closes #5462.
2019-04-23 10:08:25 -07:00
John MacFarlane
dd344715f6 EPUB writer: Ensure unique ids for styleesheets in content.opf.
Closes #5463.
2019-04-23 09:48:50 -07:00
John MacFarlane
6699471484 HTML writer: Add class="heading" to level 7+ Headers...
rendered as p tags. Closes #5457.
2019-04-20 22:24:24 -07:00
John MacFarlane
e1cc73ed97 Text.Pandoc.PDF: replace </> with literal "/".
We use forward-slash for a directory separator in tmpDir,
even on Windows (because that's what tex likes).  So we
should not put a backslash between the tmpDir and the
filename on Windows.  This is harmless enough in normal
Windows setups, but it breaks on Cygwin.

Closes #5451.  Thanks to @cc2x for noticing and diagnosing
the problem.
2019-04-16 21:12:42 -07:00
John MacFarlane
144b2eabc2 Tigthen up fix to #5446.
We only treat Span as transparent if it has no attributes.
2019-04-16 09:32:19 -07:00
John MacFarlane
e409509a68 RST writer: treat Span as transparent.
Previously an Emph inside a Span was being treated as
nested markup and ignored.  With this patch, the Span
is just ignored.

Closes #5446.
2019-04-15 09:48:11 -07:00
John MacFarlane
8f01044062 LaTeX reader: add braces when resolving \DeclareMathOperator.
These seem to be needed for xelatex but not pdflatex.
Closes #5441.
2019-04-10 21:26:23 -07:00
Mauro Bieg
90dc3a3e13 Asciify.hs: add Turkish undotted-i (#5434)
fixes #5433
2019-04-07 11:01:56 -06:00
John MacFarlane
0c97aceea8 More fixes to beamer table footnotes. 2019-04-05 11:31:18 -07:00
John MacFarlane
708236aa8e LaTeX writer: rename stInMinipage -> stExternalNotes 2019-04-05 11:12:23 -07:00
John MacFarlane
085a893109 Make footnotes work properly in beamer tables.
This fixes a regression in beamer due to the fix to #5367.
We put table footnotes outside the table in beamer, because
footnote/footnotehyper don't work with beamer.
2019-04-05 11:02:24 -07:00
John MacFarlane
4f572ddf69 Vimwiki reader: improve handling of internal links.
1) Don't append `.html`
2) Add `wikilink` title

This mirrors behavior of other wiki readers.  Generally the
`.html` extension is not wanted.  It may be important for
output to HTML in certain circumstances, but it can always
be added using a filter that matches on links with title
`wikilink`.

Note that if you have a workflow that uses pandoc to convert
vimwiki to readable HTML pages, you may need to add such a
filter to reproduce current behavior.

Here is a filter that does the job:

```lua
function Link(el)
    if el.title == 'wikilink' then
      el.target = el.target .. ".html"
    end
    return el
end
```

Save this as `fixlinks.lua` and use with `--lua-filter fixlinks.lua`.

Closes #5414.
2019-04-05 10:04:28 -07:00
Jesse Rosenthal
ba7898bb3d PowerPoint writer code style fix
I had been using record syntax in an ADT, is bad style, since it means
that each record produces a partial function. Fortunately we weren't
using the partial functions anywhere, so this changes it to positional
syntax.
2019-04-05 12:05:08 -04:00
Jesse Rosenthal
ab5c701343 PowerPoint writer: expand builtin reference doc to model all layouts
The previous built-in reference doc had only title and content
layouts. Add in a section-header slide and a two-content slide, so
users can more easily modify it to build their own templates.

Golden files needed to be regenerated. Checked on MS PowerPoint 2013.
2019-04-05 08:50:39 -04:00
Jesse Rosenthal
891ea3112b PowerPoint writer: Always open up in slide view
When editing a template/reference-doc, the user might be in Master
view, but when producing a slide show, it is assumed that slide view
will be desired. This removes the "lastView" attr from the
viewProps.xml slide so that the presentation will always open up in
slide view.

Note this requires creating a new "ppt/viewProps.xml" instead of just
moving over the old one from the viewProps file. Since this produces a
slightly different order of xml files in the content manifest, the
golden files will have to be rebuilt.
2019-04-04 10:46:30 -04:00
John MacFarlane
c4e24c2ccb Add support for go with --listings.
Closes #5427.
2019-04-03 08:02:39 -07:00
John MacFarlane
ef2c970d0e Fix harmless error in file-scope code.
Closes #5422.
2019-04-02 16:33:59 -07:00
Derek Chen-Becker
45944b51a0 Add XWiki Support (#4167)
Add XWiki Support

Closes #1800
2019-04-02 17:27:02 -06:00
Jesse Rosenthal
0abb858a99 PowerPoint writer: Remove handoutsMasterList from template presentation.xml
We don't build it at the moment, so it was causing corruption.
2019-04-01 17:01:07 -04:00
Jesse Rosenthal
9a77da475e PowerPoint writer: Build sp trees correctly
We were previously carrying over too many elements from the layout,
which produced visual artifacts and some corruption. This empties the
sptree (except for properties) after building the shapes, and then
inserts them.

Together with 5e944bf5, fixes #5402

(Note that this addresses the issue and template in that particular
bug report. Other issues will arise no doubt arise with other
templates.)
2019-04-01 15:29:23 -04:00
Jesse Rosenthal
5e944bf5b0 PowerPoint writer: Correct application of reference doc for content
Previously we had applied content shapes based on their index (which
was "1", "2" in MS Word 2013). It turns out that this was a
convention, and could not be relied on. Instead we use a default
type (ie, a ph tag with no "type"). This is more correct, and should
make the application of reference documents in PowerPoint much more
robust.
2019-04-01 14:45:56 -04:00
Jesse Rosenthal
da802c1a2e PowerPoint writer: Make default placeholder type for template lookup
This is the first step toward making templating work better. It seems
that content shapes have a default ph type. In other words, shapes
with *NO PH TYPE* should be considered to have an "obj" ph type, and
used as content shapes.

see https://github.com/scanny/python-pptx/blob/master/docs/dev/analysis/placeholders/slide-placeholders/placeholders-in-new-slide.rst
2019-04-01 14:45:56 -04:00
Mauro Bieg
0fa6951dc1 Dokuwiki Reader fix: parse single curly brace (#5417)
fixes #5416
2019-04-01 11:36:47 -06:00
Jesse Rosenthal
f72a67efdd Pptx writer: Apply speaker snotes to metadata slide if applicable.
If the slide deck has a metadata slide (with author, title, etc) and
has speaker notes before any body content, the speaker notes will be
applied to the metadata slide. If there is no metadata slide, pandoc
will behave as before.
2019-03-31 17:09:00 -04:00
Jesse Rosenthal
dda5f0a572 Pptx writer: Correctly handle notes after section-title header
Previously, if notes came after a section-title header (ie, a level-1
header in a slide-level=2 presentation), they would go on the next
slide. This keeps them on the slide with the header.
2019-03-30 22:44:55 -04:00
John MacFarlane
79c82a2550 ipynb reader/writer: use format 'ipynb' for raw cell where no format given.
According to nbformat docs, this is supposed to render in every
format.  We don't do that, but we at least preserve it as a raw
block in markdown, so you can round-trip.
2019-03-30 09:57:43 -07:00
John MacFarlane
acab2087bb ipynb writer - consolidate adjacent raw blocks.
Sometimes pandoc creates two HTML blocks, e.g. one for
the open tag and one for a close tag.  If these aren't
consolidated, only one will show up in output cell.
2019-03-29 21:08:00 -07:00
John MacFarlane
93ee73e1dc LaTeX writer: Avoid inadvertently creating ? or ! ligatures.
These are upside down ? and !, resp.

Closes #5407.
2019-03-29 10:04:22 -07:00
John MacFarlane
1595860059 HTML writer: Don't add data- prefix to RDFa attributes.
Closes #5403.
2019-03-28 21:01:24 -07:00
John MacFarlane
40865958ce Markdown reader: fenced div takes priority over setext header.
For

    ::: {.cell}
    ---
    :::
2019-03-28 17:39:22 -07:00
John MacFarlane
261ad9fb3d Ipynb reader: use html for a raw cell with no format.
The nbformat spec says that when no format is specified,
the raw cell will be rendered in every markup format.
Pandoc doesn't have a construct that works this way,
so we just fall back to `html`.
2019-03-28 17:18:11 -07:00
John MacFarlane
83ea529cf3 Ipynb writer: fixed carry-over of nbformat from metadata.
Previously we wrongly assumed it would be in a MetaString.
It's an a MetaInlines.
2019-03-28 17:12:44 -07:00
John MacFarlane
2b0a0bba9c Shared - improve metaToJSON with numbers.
We now do a better job marshalling numbers from MetaString
OR MetaInlines into JSON Number.
2019-03-28 17:01:32 -07:00
John MacFarlane
4c9a68e83f Markdown writer: better rendering of numbers.
If the number is integral, we render it as an integral
not a float.

Closes #5398.
2019-03-28 16:20:39 -07:00
John MacFarlane
ba613b2e9e Markdown writer: proper rendering of empty map in YAML metadata.
Should be `{}` not empty string.

Partially addresses #5398.
2019-03-28 14:10:00 -07:00
John MacFarlane
7fa5fbed9e Use strict instead of lazy sum.
sum is lazy; replace with `foldl' (+) 0` to avoid stack
overflow in Text.Pandoc.Pretty with very long strings.

Closes #5401.
2019-03-28 13:51:15 -07:00
John MacFarlane
612e6555a9 ipynb writer: preserve nbformat_minor if it's given.
This helps with round-tripping.
2019-03-27 18:04:20 -07:00
John MacFarlane
6157f7ec4f Writers.Shared.metaValueToJSON: use Number Values for integers.
Pandoc's MetaValue doesn't have a distinguished number type,
so numbers are put in MetaStrings.  If the MetaString consists
entirely of digits, we convert it to a Number.

We should probably consider adding a MetaNumber constructor
to MetaValue, for better round-tripping with JSON etc.

This change aids round-tripping in ipynb metadata fields,
like `toc_depth`.
2019-03-27 17:11:14 -07:00
John MacFarlane
2138ef8239 ipynb reader: avoid introducing spurious .0 on integers in metadata. 2019-03-27 16:52:17 -07:00
John MacFarlane
3ecc8d154b Drop support for ghc < 8. 2019-03-27 11:38:24 -07:00
John MacFarlane
542272a52a JATS writer: Ensure that plain strings go inside <pub-id> tag.
See #5397.
2019-03-26 21:43:59 -07:00
John MacFarlane
052684712b HTML reader: read data-foo attribute into foo.
The HTML writer adds the `data-` prefix for HTML5
for nonstandard attributes.  But the attributes are
represented in the AST without the `data-` prefix,
so we should strip this when reading HTML.

Closes #5392.
2019-03-25 08:43:59 -07:00
John MacFarlane
1e60776226 LaTeX writer: Fix footnotes in table caption and cells.
This fixes a bug wherein footnotes appeared in the wrong
order, and with duplicate numbers, when in table captions
and cells.

We now use regular `\footnote` commands, even in the table
caption and the minipages containing cells. Apparently
longtable knows how to handle this.

Closes #5367.
2019-03-22 11:55:41 -07:00
John MacFarlane
97acf152e0 fetchItem: don't treat UNC paths as protocol-relative URLs.
These are paths beginning `//?/UNC/...`.  Closes #5127.
2019-03-22 11:22:21 -07:00
richarddavis
567a43ace3 Improve pdfSize in ImageSize by ignoring all whitespace in /MediaBox command (#5383)
This fix ignores all whitespace in the PDF /MediaBox line so that a wider range of PDF sizes can be read. This improves fix to #4322.
2019-03-21 10:43:56 -06:00
John MacFarlane
66e5f0ff8d Docx writer: Use w:br without attributes for line breaks.
We previously added the attribute `type="textWrapping"`, but
this causes problems on Word Online.

Closes #5377.
2019-03-21 09:28:16 -07:00