Commit graph

5550 commits

Author SHA1 Message Date
Alexander Krotov
f8e255053d Muse writer: write empty inline lists as <verbatim></verbatim> 2018-03-07 18:35:04 +03:00
Alexander Krotov
39b31ef3cb Muse writer: remove empty Str from the beginning of inline lists during normalization 2018-03-07 16:25:15 +03:00
Alexander Krotov
1b1b6f02d5 Muse writer: escape "-" to avoid creating bullet lists 2018-03-07 15:19:36 +03:00
Alexander Krotov
4d2bf177fc Muse reader: do not produce empty Str element for unindented verse lines 2018-03-07 14:24:16 +03:00
Alexander Krotov
31b4387a6b Muse writer: fix math expansion for more than one expression per paragraph 2018-03-06 12:58:20 +03:00
Nokome Bentley
7d193b2aad Remove extraneous, significant whitespace in JATS writer output (#4335)
This patch fixes some cases where the JATS writer was introducing
semantically significant whitespace by indenting and wrapping tags.
Note that the JATS spec has a content model for `<p>` tags of `(#PCDATA | ...`.
Any tag where `#PCDATA` children are possible should not have any
indentation. The same is true for `<th>`, `<td>`, `<term>`, `<label>`.
2018-03-05 09:44:34 -08:00
Alexander Krotov
7da6e4390c Muse writer: expand math before inline list normalization 2018-03-05 19:50:19 +03:00
John MacFarlane
987140eadc Revert "Commonmark reader: parse HTML as plain text if -raw_html."
This reverts commit 6dd2125028.
2018-03-02 19:35:22 -08:00
John MacFarlane
6dd2125028 Commonmark reader: parse HTML as plain text if -raw_html. 2018-03-02 19:30:42 -08:00
Alexander Krotov
a71a1fec69 Muse reader: fix indentation requirements for footnote continuations 2018-03-03 03:33:02 +03:00
John MacFarlane
7507117f15 Make Ext_raw_html default for commonmark format. 2018-03-02 16:30:39 -08:00
John MacFarlane
adefd86cd4 LaTeX reader: Fix regression in package options including underscore.
Closes #4424.
2018-03-02 09:33:18 -08:00
Alexander Krotov
991b57733c hlint Muse reader and writer 2018-03-02 19:51:54 +03:00
Alexander Krotov
a01573692a Muse reader: enable <literal> tags even if amuse extension is enabled
Amusewiki disables <literal> tags for security reasons.
If user wants similar behavior in pandoc, RawBlocks and RawInlines
can be removed or replaced with filters.
2018-03-02 12:52:39 +03:00
Alexander Krotov
64f8c5d99c Muse reader: remove space prefix from <literal> tag contents 2018-03-02 12:50:36 +03:00
Alexander Krotov
9dbd59a7c1 Muse writer: join strings during inline normalization 2018-03-02 01:45:01 +03:00
Alexander Krotov
177c5120a5 Muse reader: do not consume whitespace while looking for closing end tag
Fix for a bug caught by round-trip test.
2018-03-02 01:01:50 +03:00
Alexander Krotov
e881214bf9 Org writer: fix a typo s/prettyfy/prettify/ 2018-03-02 00:35:48 +03:00
Jesse Rosenthal
7d3e7a5a6d Docx reader: Handle nested sdt tags.
Previously we had only unwrapped one level of sdt tags. Now we recurse
if we find them.

Closes: #4415
2018-02-28 16:32:20 -05:00
Alexander Krotov
8b1630aae0 Muse writer: change verse markup
Use "> " instead of <verse> tag
2018-02-28 14:42:43 +03:00
Alexander Krotov
1d57f7a641 Muse writer: remove empty strings during inline normalization 2018-02-28 14:26:11 +03:00
Alexander Krotov
a7ac590b08 Muse reader: allow <quote> and other tags to be indented 2018-02-28 12:11:56 +03:00
Jesse Rosenthal
0287530a67 Powerpoint writer: use trim from Shared
Instead of writing my own.
2018-02-27 11:28:15 -05:00
Jesse Rosenthal
9abcb4f201 Powerpoint writer: Use table styles
This will use the default table style in the reference-doc file. As a
result they will be easier when using in a template, and match the
color scheme.
2018-02-27 10:19:35 -05:00
Jesse Rosenthal
cdbe45e8ee Powerpoint writer: Remove empty slides
Make sure there are no empty slides in the pptx output. Because of the
way that slides were split, these could be accidentally produced by
comments after images.

When animations are added, there will be a way to add an empty slide
with either incremental lists or pauses.

Test outputs checked with MS PowerPoint (Office 2013, Windows 10,
VBox). Both files have expected output and are not corrupted.
2018-02-27 09:12:17 -05:00
John MacFarlane
5ea43630f2 LaTeX reader: make --trace work. 2018-02-26 15:25:28 -08:00
Albert Krewinkel
b5bd8a9461
Lua: register script name in global variable
The name of the Lua script which is executed is made available in the
global Lua variable `PANDOC_SCRIPT_FILE`, both for Lua filters and
custom writers.

Closes: #4393
2018-02-24 22:43:28 +01:00
Alexander Krotov
39dd7c794b Muse reader: allow single colon in definition list term 2018-02-24 02:38:10 +03:00
Jesse Rosenthal
6de2c0710f Docx reader: code cleanup.
Make the code in `runStyleToTransform` a bit more consistent.
2018-02-23 14:51:36 -05:00
Jesse Rosenthal
3e10caad63 Docx reader: simplify custom-style reading code. 2018-02-23 14:47:52 -05:00
Jesse Rosenthal
5ada5cceac Docx reader: Don't look up dependant run styles if +styles is enabled.
It makes more sense not to interpret -- otherwise using the original
document as the reference-doc would produce two of everything: the
interpreted version and the uninterpreted style version.
2018-02-23 14:35:30 -05:00
Alexander Krotov
8f8f0f8a60 Muse writer: don't indent nested definition lists 2018-02-23 22:07:53 +03:00
Jesse Rosenthal
788cb6e9a1 Docx writer: trim trailing whitespace. 2018-02-23 11:54:00 -05:00
laptop1\Andrew
03d8696991 Docx writer: fix #3930
Fixes an issuue regarding image sizing if the same image is included more than once.

Previously, a record was kept, indexed by image source, which would include the XML for that image. For every image element in the document, this record was checked, and if the image was the same as previous examples, the same XML would be included twice. The information in this XML incudes the image description, title text, and size on the page, thus all images from the same source would always be sized the same, and have the same description. This commit fixes this by generating unique XML every time, but keeping the image ID and path if it is the same image.
2018-02-23 11:50:33 -05:00
Alexander Krotov
2eab8f4654 Muse reader: improve verse parsing
Now verse marked up with ">" (in contrast to <verse> tag) can be placed
inside lists.
2018-02-23 18:02:04 +03:00
Alexander Krotov
e810a5cc00 Export improved sepBy1 from Text.Pandoc.Parsing 2018-02-23 18:02:04 +03:00
Jesse Rosenthal
69a7209930 Presentations: Use divs to set incremental/non-incremental
Currently, html and beamer presentations use a list-inside-blockquote
convention for setting incremental and all-at-once presentation of
lists (or reversing the command-line default). This allows the user to
set this on a per-case basis with divs, named `incremental` and
`nonincremental` respectively, as in:

    ::: incremental

    - snap

    - crackle

    - pop

    :::

Note that the former list-inside-blockquote convention still works so
as not to break any existing presentations.

Closes: #4381
2018-02-22 14:40:40 -05:00
Jesse Rosenthal
8b7df2d915 Docx reader: Move pandoc inline styling inside custom-style span
Previously Emph, Strong, etc were outside the custom-style span. This
moves them inside in order to make it easier to write filters that act
on the formatting in these contents.

Tests and MANUAL example are changed to match.
2018-02-22 13:41:02 -05:00
Jesse Rosenthal
87e0728b87 Docx reader: Avoid repeated spans in custom styles.
The previous commit had a bug where custom-style spans would be read
with every recurrsion. This fixes that, and changes the example given
in the manual.
2018-02-22 13:27:34 -05:00
Jesse Rosenthal
5262c0853a Docx reader: read custom styles
This will read all paragraph and character classes as divs and spans,
respectively. Dependent styles will still be resolved, but will be
wrapped with appropriate style tags. It is controlled by the `+styles`
extension (`-f docx+styles`).

This can be used in conjunction with the `custom-style` feature in the
docx writer for a pandoc-docx editing workflow. Users can convert from
an input docx, reading the custom-styles, and then use that same input
docx file as a reference-doc for producing an output docx file. Styles
will be maintained across the conversion, even if pandoc doesn't
understand them.

Without the extension:

    $ pandoc test/docx/custom-style-reference.docx -f docx -t markdown
    This is some text.

    This is text with an *emphasized* text style. And this is text with a
    **strengthened** text style.

    > Here is a styled paragraph that inherits from Block Text.

With the extension:

    $ pandoc test/docx/custom-style-reference.docx -f docx+styles -t markdown
    ::: {custom-style="FirstParagraph"}
    This is some text.
    :::

    ::: {custom-style="BodyText"}
    This is text with an
    *[[emphasized]{custom-style="Emphatic"}]{custom-style="Emphatic"}* text
    style. And this is text with a
    **[[strengthened]{custom-style="Strengthened"}]{custom-style="Strengthened"}**
    text style.
    :::

    ::: {custom-style="MyBlockStyle"}

Closes: #1843
2018-02-22 13:05:25 -05:00
Jesse Rosenthal
88d17c6c66 Extensions: Add Ext_styles
This will be used in the docx reader (defaulting to off) to read
pargraph and character styles not understood by pandoc (as divs and
spans, respectively).
2018-02-22 12:54:57 -05:00
John MacFarlane
b8f0d15a72 LaTeX writer: Put hypertarget inside figure environment.
Previously it surrounded the figure.

This works around a problem with the endfloat package and
makes pandoc's output compatible with it.

Closes #4388.
2018-02-21 17:30:28 -08:00
John MacFarlane
0690df507b LaTeX writer: Fix image height with percentage.
This previously caused the image to be resized to
a percentage of textwidth, rather than textheight.

Closes #4389.
2018-02-21 17:18:06 -08:00
Albert Krewinkel
00d20ccd09
Org reader: allow changing emphasis syntax
The characters allowed before and after emphasis can be configured via
`#+pandoc-emphasis-pre` and `#+pandoc-emphasis-post`, respectively. This
allows to change which strings are recognized as emphasized text on a
per-document or even per-paragraph basis. The allowed characters must be
given as (Haskell) string.

    #+pandoc-emphasis-pre: "-\t ('\"{"
    #+pandoc-emphasis-post: "-\t\n .,:!?;'\")}["

If the argument cannot be read as a string, the default value is
restored.

Closes: #4378
2018-02-21 22:43:18 +01:00
Alexander Krotov
84db7e492a Muse reader: replace setState with updateState where possible 2018-02-21 12:40:37 +03:00
Jesse Rosenthal
705145956d Muse reader: fix compiler warning
lambda variable `st` shadowed an existing variable.
2018-02-20 09:17:52 -05:00
Jesse Rosenthal
b9b66d3b29 Powerpoint writer: Use ph name and idx for getting layout shapes
Internal change: when we take shapes from the layout for title,
content, etc, we should use the attributes of the "ph" (placeholder)
tag -- idx and name. This is what powerpoint uses internally, and
therefore seems more dependable across reference-docs than using the
shape names, as we had previously done.

There should be no output changes as a result of this commit.
2018-02-20 06:46:45 -05:00
Alexander Krotov
a16382b06b Muse reader: use updateState instead of setState to restore museInLink 2018-02-20 14:37:02 +03:00
Jesse Rosenthal
f1146cd7ee Powerpoint writer: Add notesMaster to presentation.xml if necessary
In previous version, we only modified the notesMaster entry in the
presentation.xml file, and removed it if necessary. But if using a
template, it might not be available. So we always delete it, and then
add it back in if necessary.

We also have to make sure that we add it appropriately the .rels file
associated with presentation.xml.
2018-02-19 15:31:20 -05:00
Alexander Krotov
5a9d7d20dd Move manyUntil to Text.Pandoc.Parsing and use it in Txt2Tags reader 2018-02-19 19:23:30 +03:00