git.iko.soy/typeable/pandoc
on master help sign in
.circleci/config.yml+1−1
since splitsnapshots
unifiedsplit
@@ -2,7 +2,7 @@ version: "2.1"
2jobs:
2jobs:
3 build:
3 build:
4 macos:
4 macos:
5− xcode: 9.4.1
5+ xcode: 11.1.0
6 environment:
6 environment:
7 HOMEBREW_NO_AUTO_UPDATE: 1
7 HOMEBREW_NO_AUTO_UPDATE: 1
8 steps:
8 steps:
.github/ISSUE_TEMPLATEdeleted−11
@@ -1,11 +0,0 @@
1−Asking a question?
2−Please use the pandoc-discuss mailing list instead:
3−https://groups.google.com/forum/#!forum/pandoc-discuss
4−This tracker is for bug reports and enhancement requests.
5−
6−Reporting a bug?
7−Please include your pandoc version and an example that allows us
8−to reproduce the problem (complete input, exact command line
9−used, expected and actual output). The smaller the example, the
10−better.
11−
.github/ISSUE_TEMPLATE/bug_report.mdnew file+25
@@ -0,0 +1,25 @@
1+---
2+name: Bug report
3+about: Create a report to help us improve
4+title: ''
5+labels: 'bug'
6+assignees: ''
7+
8+---
9+
10+<!--
11+Thank you for reporting an issue! Before you continue, please make sure that you have
12+
13+- searched the issue tracker for similar issues (including closed issues): https://github.com/jgm/pandoc/issues
14+- searched the pandoc-discuss mailing list for solutions: https://groups.google.com/forum/#!forum/pandoc-discuss
15+- reproduced your issue on the latest release of pandoc, or on https://pandoc.org/try
16+
17+Note that this bug tracker is for reporting bugs, not asking questions. For questions, use the pandoc-discuss mailing list.
18+-->
19+
20+**Explain the problem.**
21+Include the exact command line you used and all inputs necessary to reproduce the issue. Please create as minimal an example as possible, to help the maintainers isolate the problem. Explain the output you received and how it differs from what you expected.
22+
23+**Pandoc version?**
24+What version of pandoc are you using, on what OS?
25+
.github/ISSUE_TEMPLATE/config.ymlnew file+9
@@ -0,0 +1,9 @@
1+blank_issues_enabled: false
2+contact_links:
3+ - name: Ask a question
4+ url: https://groups.google.com/forum/#!forum/pandoc-discuss
5+ about: "Discussion forum for pandoc (may be used as an email list)"
6+ - name: Contributing Guidelines
7+ url: https://pandoc.org/CONTRIBUTING.html
8+ about: "Guidelines for submitting bug reports and code improvements"
9+
.github/ISSUE_TEMPLATE/feature_request.mdnew file+21
@@ -0,0 +1,21 @@
1+---
2+name: Feature request
3+about: Suggest an idea for this project
4+title: ''
5+labels: 'enhancement'
6+assignees: ''
7+
8+---
9+
10+<!--
11+Thank you for suggesting a feature! Before you continue, please make sure that you have
12+
13+- read the contributing guidelines: https://pandoc.org/CONTRIBUTING.html
14+- searched the issue tracker for similar issues (including closed issues): https://github.com/jgm/pandoc/issues
15+- searched the pandoc-discuss mailing list for relevant discussions: https://groups.google.com/forum/#!forum/pandoc-discuss
16+-->
17+
18+**Describe your proposed improvement and the problem it solves.**
19+
20+**Describe alternatives you've considered.**
21+
CONTRIBUTING.md+6−5
@@ -406,11 +406,11 @@ The library is structured as follows:
406 tree automatically.
406 tree automatically.
407 - `Text.Pandoc.Readers.*` are the readers, and `Text.Pandoc.Writers.*`
407 - `Text.Pandoc.Readers.*` are the readers, and `Text.Pandoc.Writers.*`
408 are the writers.
408 are the writers.
409− - `Text.Pandoc.Biblio` is a utility module for formatting citations
409+ - `Text.Pandoc.Citeproc.*` contain the code for citation handling,
410− using citeproc-hs.
410+ including an interface to the [citeproc] library.
411 - `Text.Pandoc.Data` is used to embed data files when the `embed_data_files`
411 - `Text.Pandoc.Data` is used to embed data files when the `embed_data_files`
412− cabal flag is used. It is generated from `src/Text/Pandoc/Data.hsb` using
412+ cabal flag is used.
413− the preprocessor [hsb2hs].
413+ - `Text.Pandoc.Emoji` is a thin wrapper around [emojis].
414 - `Text.Pandoc.Highlighting` contains the interface to the
414 - `Text.Pandoc.Highlighting` contains the interface to the
415 skylighting library, which is used for code syntax highlighting.
415 skylighting library, which is used for code syntax highlighting.
416 - `Text.Pandoc.ImageSize` is a utility module containing functions for
416 - `Text.Pandoc.ImageSize` is a utility module containing functions for
@@ -421,7 +421,6 @@ The library is structured as follows:
421 - `Text.Pandoc.PDF` contains functions for producing a PDF from a
421 - `Text.Pandoc.PDF` contains functions for producing a PDF from a
422 LaTeX source.
422 LaTeX source.
423 - `Text.Pandoc.Parsing` contains parsing functions used in multiple readers.
423 - `Text.Pandoc.Parsing` contains parsing functions used in multiple readers.
424− - `Text.Pandoc.Pretty` is a pretty-printing library specialized to
425 the needs of pandoc.
424 the needs of pandoc.
426 - `Text.Pandoc.SelfContained` contains functions for making an HTML
425 - `Text.Pandoc.SelfContained` contains functions for making an HTML
427 file "self-contained," by importing remotely linked images, CSS,
426 file "self-contained," by importing remotely linked images, CSS,
@@ -456,6 +455,8 @@ you may want to consider submitting a pull request to the
456[EditorConfig]: https://editorconfig.org/
455[EditorConfig]: https://editorconfig.org/
457[Haskell platform]: https://www.haskell.org/platform/
456[Haskell platform]: https://www.haskell.org/platform/
458[hlint]: https://hackage.haskell.org/package/hlint
457[hlint]: https://hackage.haskell.org/package/hlint
458+[citeproc]: https://hackage.haskell.org/package/citeproc
459+[emojis]: https://hackage.haskell.org/package/emojis
459[hsb2hs]: https://hackage.haskell.org/package/hsb2hs
460[hsb2hs]: https://hackage.haskell.org/package/hsb2hs
460[pre-commit hook]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
461[pre-commit hook]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
461[GitHub labels]: https://github.com/jgm/pandoc/labels
462[GitHub labels]: https://github.com/jgm/pandoc/labels
MANUAL.txt+14−15
@@ -1,7 +1,7 @@
1---
1---
2title: Pandoc User's Guide
2title: Pandoc User's Guide
3author: John MacFarlane
3author: John MacFarlane
4−date: May 31, 2021
4+date: June 20, 2021
5---
5---
6
6
7# Synopsis
7# Synopsis
@@ -675,12 +675,12 @@ header when requesting a document from a URL:
675: Extract images and other media contained in or linked from
675: Extract images and other media contained in or linked from
676 the source document to the path *DIR*, creating it if
676 the source document to the path *DIR*, creating it if
677 necessary, and adjust the images references in the document
677 necessary, and adjust the images references in the document
678− so they point to the extracted files. If the source format is
678+ so they point to the extracted files. Media are downloaded,
679− a binary container (docx, epub, or odt), the media is
679+ read from the file system, or extracted from a binary
680− extracted from the container and the original
680+ container (e.g. docx), as needed. The original file paths
681− filenames are used. Otherwise the media is read from the
681+ are used if they are relative paths not containing `..`.
682− file system or downloaded, and new filenames are constructed
682+ Otherwise filenames are constructed from the SHA1 hash of
683− based on SHA1 hashes of the contents.
683+ the contents.
684
684
685`--abbreviations=`*FILE*
685`--abbreviations=`*FILE*
686
686
@@ -1415,13 +1415,12 @@ results only for basic math, usually you will want to use
1415`--gladtex`
1415`--gladtex`
1416
1416
1417: Enclose TeX math in `<eq>` tags in HTML output. The resulting HTML
1417: Enclose TeX math in `<eq>` tags in HTML output. The resulting HTML
1418− can then be processed by [GladTeX] to produce images of the typeset
1418+ can then be processed by [GladTeX] to produce SVG images of the typeset
1419− formulas and an HTML file with links to these images.
1419+ formulas and an HTML file with these images embedded.
1420− So, the procedure is:
1421
1420
1422 pandoc -s --gladtex input.md -o myfile.htex
1421 pandoc -s --gladtex input.md -o myfile.htex
1423− gladtex -d myfile-images myfile.htex
1422+ gladtex -d image_dir myfile.htex
1424− # produces myfile.html and images in myfile-images
1423+ # produces myfile.html and images in image_dir
1425
1424
1426[MathML]: https://www.w3.org/Math/
1425[MathML]: https://www.w3.org/Math/
1427[MathJax]: https://www.mathjax.org
1426[MathJax]: https://www.mathjax.org
@@ -6505,9 +6504,9 @@ application, here are some things to keep in mind:
65054. The HTML generated by pandoc is not guaranteed to be safe.
65044. The HTML generated by pandoc is not guaranteed to be safe.
6506 If `raw_html` is enabled for the Markdown input, users can
6505 If `raw_html` is enabled for the Markdown input, users can
6507 inject arbitrary HTML. Even if `raw_html` is disabled,
6506 inject arbitrary HTML. Even if `raw_html` is disabled,
6508− users can include dangerous content in attributes for
6507+ users can include dangerous content in URLs and attributes.
6509− headings, spans, and code blocks. To be safe, you should
6510− run all the generated HTML through an HTML sanitizer.
6508+ To be safe, you should run all the generated HTML through
6509+ an HTML sanitizer.
6511
6510
6512# Authors
6511# Authors
6513
6512
SECURITY.mdnew file+12
@@ -0,0 +1,12 @@
1+# Security Policy
2+
3+## Supported Versions
4+
5+Only the most recent version of pandoc is supported with security updates.
6+
7+## Reporting a Vulnerability
8+
9+To report a vulnerability, email the maintainer, jgm@berkeley.edu.
10+But first please read the section of the manual entitled
11+[A note on security](https://pandoc.org/MANUAL.html#a-note-on-security),
12+which describes some security guarantees pandoc does NOT make.
cabal.project+9
@@ -2,3 +2,12 @@ packages: pandoc.cabal
2tests: True
2tests: True
3flags: +embed_data_files
3flags: +embed_data_files
4
4
5+source-repository-package
6+ type: git
7+ location: https://github.com/jgm/doctemplates
8+ tag: 428c26d5303cf7a2b1051fe1ffd9aafe9ba71c81
9+
10+source-repository-package
11+ type: git
12+ location: https://github.com/jgm/citeproc
13+ tag: 4ce0501cd6f9c86eee087afcf878c256e49b9615
changelog.md+149
@@ -1,5 +1,154 @@
1# Revision history for pandoc
1# Revision history for pandoc
2
2
3+## pandoc 2.14.0.3 (2021-06-22)
4+
5+ * Text.Pandoc.MediaBag `insertMediaBag`: ensure we get a sane mediaPath
6+ for URLs (#7391). In earlier 2.14.x versions, we'd get
7+ incorrect paths for resources downloaded from URLs when the
8+ media are extracted (including in PDF production).
9+ * Text.Pandoc.Parsing: improve `emailAddress` (#7398).
10+ Previously the parser would accept characters in domains
11+ that are illegal in domains, and this sometimes caused it
12+ to gobble bits of the following text.
13+ * txt2tags reader: modify the email address parser so
14+ it still includes form parameters, even after the change to
15+ `emailAddress` in Text.Pandoc.Parsing.
16+ * Text.Pandoc.Readers.Metadata: Fix regression with comment-only YAML
17+ metadata blocks (#7400).
18+ * reveal.js writer and template: better handling of options. Previously
19+ it was impossible to specify false values for options that default to
20+ true (e.g. `center`); setting the option to false just caused the portion
21+ of the template setting the option to be omitted. Now we prepopulate
22+ all the variables with their default values, including them all
23+ unconditionally and allowing them to be overridden.
24+ * Markdown writer: Fix regression in code blocks with attributes (#7397).
25+ Code blocks with a single class but nonempty attributes
26+ were having attributes drop as a result of #7242.
27+ * LaTeX writer:
28+ + Add strut at end of minipage if it contains line breaks.
29+ Without them, the last line is not as tall as it should be in
30+ some cases.
31+ + Always use a minipage for cells with line breaks, when
32+ width information is available (#7393). Otherwise the way we treat them
33+ can lead to content that overflows a cell.
34+ + Use `\strut` instead of `~` before `\\` in empty line.
35+ * Use lts-18.0 stack resolver.
36+ * Require skylighting 0.10.5.2 (adding support for Swift).
37+ * Require commonmark 0.2.1.
38+ * Rephrase section on unsafe HTML in manual.
39+ * Create SECURITY.md
40+
41+## pandoc 2.14.0.2 (2021-06-13)
42+
43+ * Fix MediaBag regressions (#7345). iIn the 2.14 release `--extract-media`
44+ stopped working as before; there could be mismatches between the
45+ paths in the rendered document and the extracted media.
46+ This patch makes several changes that restore the earlier behavior
47+ (while keeping the same API). The `mediaPath` in 2.14 was always
48+ constructed from the SHA1 hash of the media contents. Now, we
49+ preserve the original path unless it's an absolute path or contains
50+ `..` segments (in that case we use a path based on the SHA1 hash of
51+ the contents).
52+
53+ In Text.Pandoc.MediaBag, `mediaDirectory` and `mediaItems` now use the
54+ `mediaPath`, rather than the mediabag key, for the first component of the
55+ tuple. This makes more sense, I think, and fits with the documentation of
56+ these functions; eventually, though, we should rework the API so that
57+ `mediaItems` returns both the keys and the MediaItems.
58+
59+ In Text.Pandoc.Class.IO, rewriting of source paths in `extractMedia` has
60+ been fixed.
61+
62+ In Text.Pandoc.Class.PandocMonad, `fillMediaBag` has been modified so that
63+ it doesn't modify image paths (that was part of the problem in #7345).
64+
65+ We now do path normalization (e.g. `\` separators on Windows) in
66+ writing the media.
67+
68+ * Text.Pandoc.PDF:
69+
70+ + Text.Pandoc.PDF: Fix regression in 2.14 for generation of PDFs with
71+ SVGs (#7344).
72+ + Only print relevant part of environment on `--verbose`. Since
73+ `--verbose` output might be put in an issue, we want to avoid
74+ spilling out secrets in environment variables.
75+
76+ * Markdown reader: fix pipe table regression in 2.11.4 (#7343).
77+ Previously pipe tables with empty headers (that is, a header
78+ line with all empty cells) would be rendered as headerless
79+ tables. This broke in 2.11.4. The fix here is to produce an
80+ AST with an empty table head when a pipe table has all empty
81+ header cells.
82+
83+ * LaTeX reader: don't allow optional `*` on symbol control sequences
84+ (#7340). Generally we allow optional starred variants of LaTeX commands
85+ (since many allow them, and if we don't accept these explicitly,
86+ ignoring the star usually gives acceptable results). But we
87+ don't want to do this for `\(*\)` and similar cases.
88+
89+ * Docx reader: handle absolute URIs in Relationship Target (#7374).
90+
91+ * Docx writer: fix handling of empty table headers (Albert Krewinkel,
92+ #7369). A table header which does not contain any cells is now treated as
93+ an empty header.
94+
95+ * LaTeX writer: Fix regression in table header position (#7347).
96+ In recent versions the table headers were no longer bottom-aligned
97+ (if more than one line). This patch fixes that by using minipages
98+ for table headers in non-simple tables.
99+
100+ * CommonMark writer:
101+
102+ + Do not use simple class for fenced-divs (Jan Tojnar, amends #7242.)
103+ + Do not throw away attributes when `Ext_attributes` is enabled.
104+ `Ext_attributes` covers at least the following:
105+ `Ext_fenced_code_attributes`, `Ext_header_attributes`,
106+ `Ext_inline_code_attributes`, `Ext_link_attributes`.
107+
108+ * Markdown writer:
109+
110+ + Allow `pipe_tables` to be disabled for commonmark formats
111+ (`commonmark_x`, `gfm`) (#7375).
112+ + Re-use functions from Text.Pandoc.Markdown.Inline (Jan Tojnar).
113+
114+ * DocBook writer: Remove non-existent admonitions (Jan Tojnar).
115+ `attention`, `error` and `hint` are reStructuredText specific.
116+
117+ * HTML writer: Don't omit width attribute on div (#7342).
118+
119+ * Text.Pandoc.MIME, `extensionFromMimeType`: add a few special cases.
120+ When we do a reverse lookup in the MIME table, we just get the
121+ last match, so when the same mime type is associated with several
122+ different extensions, we sometimes got weird results, e.g. `.vs`
123+ for `text/plain`. These special cases help us get the most standard
124+ extensions for mime types like `text/plain`.
125+
126+ * Lua utils: fix handling of table headers in `from_simple_table` (Albert
127+ Krewinkel, #7369). Passing an empty list of header cells now results
128+ in an empty table header.
129+
130+ * Text.Pandoc.Citeproc:
131+
132+ + Avoid duplicate classes and attributes on references div.
133+ + Fix regression in citeproc processing (#7376). If inline
134+ references are used (in the metadata `references` field), we
135+ should still only include in the bibliography items that are
136+ actually cited (unless `nocite` is used).
137+
138+ * Require citeproc 0.4.0.1. This fixes a bug which led to doubled
139+ "et al." in some (rare) circumstances.
140+
141+ * MANUAL.txt:
142+
143+ + Mention GladTeX for EPUB export (Sebastian Humenda).
144+ This updates the manual and the web site about the GladTeX usage.
145+ + More details and a useful link for YAML syntax.
146+
147+ * CONTRIBUTING.md: update modules overview (Albert Krewinkel).
148+
149+ * using-the-pandoc-api.md: switch from String to Text (Albert Krewinkel).
150+
151+
3## pandoc 2.14.0.1 (2021-06-01)
152## pandoc 2.14.0.1 (2021-06-01)
4
153
5 * Commonmark reader: Fix regression in 2.14 with YAML metdata block parsing,
154 * Commonmark reader: Fix regression in 2.14 with YAML metdata block parsing,
data/templates/default.latex+29−29
@@ -36,35 +36,6 @@ $for(classoption)$
36 $classoption$$sep$,
36 $classoption$$sep$,
37$endfor$
37$endfor$
38]{$documentclass$}
38]{$documentclass$}
39−$if(title)$
40−\title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
41−$endif$
42−$if(subtitle)$
43−$if(beamer)$
44−$else$
45−\usepackage{etoolbox}
46−\makeatletter
47−\providecommand{\subtitle}[1]{% add subtitle to \maketitle
48− \apptocmd{\@title}{\par {\large #1 \par}}{}{}
49−}
50−\makeatother
51−$endif$
52−\subtitle{$subtitle$}
53−$endif$
54−\author{$for(author)$$author$$sep$ \and $endfor$}
55−\date{$date$}
56−$if(beamer)$
57−$if(institute)$
58−\institute{$for(institute)$$institute$$sep$ \and $endfor$}
59−$endif$
60−$if(titlegraphic)$
61−\titlegraphic{\includegraphics{$titlegraphic$}}
62−$endif$
63−$if(logo)$
64−\logo{\includegraphics{$logo$}}
65−$endif$
66−$endif$
67−
68$if(beamer)$
39$if(beamer)$
69$if(background-image)$
40$if(background-image)$
70\usebackgroundtemplate{%
41\usebackgroundtemplate{%
@@ -452,6 +423,35 @@ $if(csquotes)$
452\usepackage{csquotes}
423\usepackage{csquotes}
453$endif$
424$endif$
454
425
426+$if(title)$
427+\title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
428+$endif$
429+$if(subtitle)$
430+$if(beamer)$
431+$else$
432+\usepackage{etoolbox}
433+\makeatletter
434+\providecommand{\subtitle}[1]{% add subtitle to \maketitle
435+ \apptocmd{\@title}{\par {\large #1 \par}}{}{}
436+}
437+\makeatother
438+$endif$
439+\subtitle{$subtitle$}
440+$endif$
441+\author{$for(author)$$author$$sep$ \and $endfor$}
442+\date{$date$}
443+$if(beamer)$
444+$if(institute)$
445+\institute{$for(institute)$$institute$$sep$ \and $endfor$}
446+$endif$
447+$if(titlegraphic)$
448+\titlegraphic{\includegraphics{$titlegraphic$}}
449+$endif$
450+$if(logo)$
451+\logo{\includegraphics{$logo$}}
452+$endif$
453+$endif$
454+
455\begin{document}
455\begin{document}
456$if(has-frontmatter)$
456$if(has-frontmatter)$
457\frontmatter
457\frontmatter
data/templates/default.revealjs+70−128
@@ -90,256 +90,198 @@ $endif$
90 // Full list of configuration options available at:
90 // Full list of configuration options available at:
91 // https://revealjs.com/config/
91 // https://revealjs.com/config/
92 Reveal.initialize({
92 Reveal.initialize({
93−$if(center)$
94− // Determines whether slide content should be vertically centered
95− center: $center$,
96−$endif$
97−$if(controls)$
98 // Display controls in the bottom right corner
93 // Display controls in the bottom right corner
99 controls: $controls$,
94 controls: $controls$,
100−$endif$
95+
101−$if(controlsTutorial)$
102 // Help the user learn the controls by providing hints, for example by
96 // Help the user learn the controls by providing hints, for example by
103 // bouncing the down arrow when they first encounter a vertical slide
97 // bouncing the down arrow when they first encounter a vertical slide
104 controlsTutorial: $controlsTutorial$,
98 controlsTutorial: $controlsTutorial$,
105−$endif$
99+
106−$if(controlsLayout)$
107 // Determines where controls appear, "edges" or "bottom-right"
100 // Determines where controls appear, "edges" or "bottom-right"
108 controlsLayout: '$controlsLayout$',
101 controlsLayout: '$controlsLayout$',
109−$endif$
102+
110−$if(controlsBackArrows)$
111 // Visibility rule for backwards navigation arrows; "faded", "hidden"
103 // Visibility rule for backwards navigation arrows; "faded", "hidden"
112 // or "visible"
104 // or "visible"
113 controlsBackArrows: '$controlsBackArrows$',
105 controlsBackArrows: '$controlsBackArrows$',
114−$endif$
106+
115−$if(progress)$
116 // Display a presentation progress bar
107 // Display a presentation progress bar
117 progress: $progress$,
108 progress: $progress$,
118−$endif$
109+
119−$if(slideNumber)$
120 // Display the page number of the current slide
110 // Display the page number of the current slide
121 slideNumber: $slideNumber$,
111 slideNumber: $slideNumber$,
122−$endif$
112+
123−$if(showSlideNumber)$
124 // 'all', 'print', or 'speaker'
113 // 'all', 'print', or 'speaker'
125 showSlideNumber: '$showSlideNumber$',
114 showSlideNumber: '$showSlideNumber$',
126−$endif$
115+
127 // Add the current slide number to the URL hash so that reloading the
116 // Add the current slide number to the URL hash so that reloading the
128 // page/copying the URL will return you to the same slide
117 // page/copying the URL will return you to the same slide
129− hash: $if(hash)$$hash$$else$true$endif$,
118+ hash: $hash$,
130−$if(hashOneBasedIndex)$
119+
131 // Start with 1 for the hash rather than 0
120 // Start with 1 for the hash rather than 0
132 hashOneBasedIndex: $hashOneBasedIndex$,
121 hashOneBasedIndex: $hashOneBasedIndex$,
133−$endif$
122+
134−$if(history)$
123+ // Flags if we should monitor the hash and change slides accordingly
124+ respondToHashChanges: $respondToHashChanges$,
125+
135 // Push each slide change to the browser history
126 // Push each slide change to the browser history
136 history: $history$,
127 history: $history$,
137−$endif$
128+
138−$if(keyboard)$
139 // Enable keyboard shortcuts for navigation
129 // Enable keyboard shortcuts for navigation
140 keyboard: $keyboard$,
130 keyboard: $keyboard$,
141−$endif$
131+
142−$if(overview)$
143 // Enable the slide overview mode
132 // Enable the slide overview mode
144 overview: $overview$,
133 overview: $overview$,
145−$endif$
134+
146−$if(center)$
135+ // Disables the default reveal.js slide layout (scaling and centering)
136+ // so that you can use custom CSS layout
137+ disableLayout: false,
138+
147 // Vertical centering of slides
139 // Vertical centering of slides
148 center: $center$,
140 center: $center$,
149−$endif$
141+
150−$if(touch)$
151 // Enables touch navigation on devices with touch input
142 // Enables touch navigation on devices with touch input
152 touch: $touch$,
143 touch: $touch$,
153−$endif$
144+
154−$if(loop)$
155 // Loop the presentation
145 // Loop the presentation
156 loop: $loop$,
146 loop: $loop$,
157−$endif$
147+
158−$if(rtl)$
159 // Change the presentation direction to be RTL
148 // Change the presentation direction to be RTL
160 rtl: $rtl$,
149 rtl: $rtl$,
161−$endif$
150+
162−$if(navigationMode)$
163 // see https://revealjs.com/vertical-slides/#navigation-mode
151 // see https://revealjs.com/vertical-slides/#navigation-mode
164 navigationMode: '$navigationMode$',
152 navigationMode: '$navigationMode$',
165−$endif$
153+
166−$if(shuffle)$
167 // Randomizes the order of slides each time the presentation loads
154 // Randomizes the order of slides each time the presentation loads
168 shuffle: $shuffle$,
155 shuffle: $shuffle$,
169−$endif$
156+
170−$if(fragments)$
171 // Turns fragments on and off globally
157 // Turns fragments on and off globally
172 fragments: $fragments$,
158 fragments: $fragments$,
173−$endif$
159+
174−$if(fragmentInURL)$
175 // Flags whether to include the current fragment in the URL,
160 // Flags whether to include the current fragment in the URL,
176 // so that reloading brings you to the same fragment position
161 // so that reloading brings you to the same fragment position
177 fragmentInURL: $fragmentInURL$,
162 fragmentInURL: $fragmentInURL$,
178−$endif$
163+
179−$if(embedded)$
180 // Flags if the presentation is running in an embedded mode,
164 // Flags if the presentation is running in an embedded mode,
181 // i.e. contained within a limited portion of the screen
165 // i.e. contained within a limited portion of the screen
182 embedded: $embedded$,
166 embedded: $embedded$,
183−$endif$
167+
184−$if(help)$
185 // Flags if we should show a help overlay when the questionmark
168 // Flags if we should show a help overlay when the questionmark
186 // key is pressed
169 // key is pressed
187 help: $help$,
170 help: $help$,
188−$endif$
171+
189−$if(pause)$
190− // Flags if it should be possible to pause the presentation (blackout)
172+ // Flags if it should be possible to pause the presentation (blackout)
191− pause: $pause$,
173+ pause: $pause$,
192−$endif$
174+
193−$if(showNotes)$
194 // Flags if speaker notes should be visible to all viewers
175 // Flags if speaker notes should be visible to all viewers
195 showNotes: $showNotes$,
176 showNotes: $showNotes$,
196−$endif$
177+
197−$if(autoPlayMedia)$
198− // Global override for autoplaying embedded media (video/audio/iframe)
178+ // Global override for autoplaying embedded media (null/true/false)
199− // - null: Media will only autoplay if data-autoplay is present
200− // - true: All media will autoplay, regardless of individual setting
201− // - false: No media will autoplay, regardless of individual setting
202 autoPlayMedia: $autoPlayMedia$,
179 autoPlayMedia: $autoPlayMedia$,
203−$endif$
180+
204−$if(preloadIframes)$
205− // Global override for preloading lazy-loaded iframes
181+ // Global override for preloading lazy-loaded iframes (null/true/false)
206− // - null: Iframes with data-src AND data-preload will be loaded when within
207− // the viewDistance, iframes with only data-src will be loaded when visible
208− // - true: All iframes with data-src will be loaded when within the viewDistance
209− // - false: All iframes with data-src will be loaded only when visible
210 preloadIframes: $preloadIframes$,
182 preloadIframes: $preloadIframes$,
211−$endif$
183+
212−$if(autoSlide)$
213 // Number of milliseconds between automatically proceeding to the
184 // Number of milliseconds between automatically proceeding to the
214 // next slide, disabled when set to 0, this value can be overwritten
185 // next slide, disabled when set to 0, this value can be overwritten
215 // by using a data-autoslide attribute on your slides
186 // by using a data-autoslide attribute on your slides
216 autoSlide: $autoSlide$,
187 autoSlide: $autoSlide$,
217−$endif$
188+
218−$if(autoSlideStoppable)$
219 // Stop auto-sliding after user input
189 // Stop auto-sliding after user input
220 autoSlideStoppable: $autoSlideStoppable$,
190 autoSlideStoppable: $autoSlideStoppable$,
221−$endif$
191+
222−$if(autoSlideMethod)$
223 // Use this method for navigation when auto-sliding
192 // Use this method for navigation when auto-sliding
224 autoSlideMethod: $autoSlideMethod$,
193 autoSlideMethod: $autoSlideMethod$,
225−$endif$
194+
226−$if(defaultTiming)$
227 // Specify the average time in seconds that you think you will spend
195 // Specify the average time in seconds that you think you will spend
228 // presenting each slide. This is used to show a pacing timer in the
196 // presenting each slide. This is used to show a pacing timer in the
229 // speaker view
197 // speaker view
230 defaultTiming: $defaultTiming$,
198 defaultTiming: $defaultTiming$,
231−$endif$
199+
232−$if(totalTime)$
233− // Specify the total time in seconds that is available to
234− // present. If this is set to a nonzero value, the pacing
235− // timer will work out the time available for each slide,
236− // instead of using the defaultTiming value
237− totalTime: $totalTime$,
238−$endif$
239−$if(minimumTimePerSlide)$
240− // Specify the minimum amount of time you want to allot to
241− // each slide, if using the totalTime calculation method. If
242− // the automated time allocation causes slide pacing to fall
243− // below this threshold, then you will see an alert in the
244− // speaker notes window
245− minimumTimePerSlide: $minimumTimePerSlide$,
246−$endif$
247−$if(mouseWheel)$
248 // Enable slide navigation via mouse wheel
200 // Enable slide navigation via mouse wheel
249 mouseWheel: $mouseWheel$,
201 mouseWheel: $mouseWheel$,
250−$endif$
202+
251−$if(rollingLinks)$
203+ // The display mode that will be used to show slides
252− // Apply a 3D roll to links on hover
204+ display: '$display$',
253− rollingLinks: $rollingLinks$,
205+
254−$endif$
255−$if(hideInactiveCursor)$
256 // Hide cursor if inactive
206 // Hide cursor if inactive
257 hideInactiveCursor: $hideInactiveCursor$,
207 hideInactiveCursor: $hideInactiveCursor$,
258−$endif$
208+
259−$if(hideCursorTime)$
260 // Time before the cursor is hidden (in ms)
209 // Time before the cursor is hidden (in ms)
261 hideCursorTime: $hideCursorTime$,
210 hideCursorTime: $hideCursorTime$,
262−$endif$
211+
263−$if(hideAddressBar)$
264− // Hides the address bar on mobile devices
265− hideAddressBar: $hideAddressBar$,
266−$endif$
267−$if(previewLinks)$
268 // Opens links in an iframe preview overlay
212 // Opens links in an iframe preview overlay
269 previewLinks: $previewLinks$,
213 previewLinks: $previewLinks$,
270−$endif$
214+
271−$if(transition)$
272− // Transition style
273− transition: '$transition$', // none/fade/slide/convex/concave/zoom
215+ // Transition style (none/fade/slide/convex/concave/zoom)
274−$endif$
216+ transition: '$transition$',
275−$if(transitionSpeed)$
217+
276− // Transition speed
218+ // Transition speed (default/fast/slow)
277− transitionSpeed: '$transitionSpeed$', // default/fast/slow
219+ transitionSpeed: '$transitionSpeed$',
278−$endif$
220+
279−$if(backgroundTransition)$
280 // Transition style for full page slide backgrounds
221 // Transition style for full page slide backgrounds
281− backgroundTransition: '$backgroundTransition$', // none/fade/slide/convex/concave/zoom
222+ // (none/fade/slide/convex/concave/zoom)
282−$endif$
223+ backgroundTransition: '$backgroundTransition$',
283−$if(viewDistance)$
224+
284 // Number of slides away from the current that are visible
225 // Number of slides away from the current that are visible
285 viewDistance: $viewDistance$,
226 viewDistance: $viewDistance$,
286−$endif$
227+
287−$if(mobileViewDistance)$
288 // Number of slides away from the current that are visible on mobile
228 // Number of slides away from the current that are visible on mobile
289 // devices. It is advisable to set this to a lower number than
229 // devices. It is advisable to set this to a lower number than
290 // viewDistance in order to save resources.
230 // viewDistance in order to save resources.
291 mobileViewDistance: $mobileViewDistance$,
231 mobileViewDistance: $mobileViewDistance$,
292−$endif$
293$if(parallaxBackgroundImage)$
232$if(parallaxBackgroundImage)$
233+
294 // Parallax background image
234 // Parallax background image
295 parallaxBackgroundImage: '$parallaxBackgroundImage$', // e.g. "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'"
235 parallaxBackgroundImage: '$parallaxBackgroundImage$', // e.g. "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'"
296$else$
236$else$
297$if(background-image)$
237$if(background-image)$
238+
298 // Parallax background image
239 // Parallax background image
299 parallaxBackgroundImage: '$background-image$', // e.g. "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'"
240 parallaxBackgroundImage: '$background-image$', // e.g. "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'"
300$endif$
241$endif$
301$endif$
242$endif$
302$if(parallaxBackgroundSize)$
243$if(parallaxBackgroundSize)$
244+
303 // Parallax background size
245 // Parallax background size
304 parallaxBackgroundSize: '$parallaxBackgroundSize$', // CSS syntax, e.g. "2100px 900px"
246 parallaxBackgroundSize: '$parallaxBackgroundSize$', // CSS syntax, e.g. "2100px 900px"
305$endif$
247$endif$
306$if(parallaxBackgroundHorizontal)$
248$if(parallaxBackgroundHorizontal)$
249+
307 // Amount to move parallax background (horizontal and vertical) on slide change
250 // Amount to move parallax background (horizontal and vertical) on slide change
308 // Number, e.g. 100
251 // Number, e.g. 100
309 parallaxBackgroundHorizontal: $parallaxBackgroundHorizontal$,
252 parallaxBackgroundHorizontal: $parallaxBackgroundHorizontal$,
310$endif$
253$endif$
311$if(parallaxBackgroundVertical)$
254$if(parallaxBackgroundVertical)$
255+
312 parallaxBackgroundVertical: $parallaxBackgroundVertical$,
256 parallaxBackgroundVertical: $parallaxBackgroundVertical$,
313$endif$
257$endif$
314$if(width)$
258$if(width)$
259+
315 // The "normal" size of the presentation, aspect ratio will be preserved
260 // The "normal" size of the presentation, aspect ratio will be preserved
316 // when the presentation is scaled to fit different resolutions. Can be
261 // when the presentation is scaled to fit different resolutions. Can be
317 // specified using percentage units.
262 // specified using percentage units.
318 width: $width$,
263 width: $width$,
319$endif$
264$endif$
320$if(height)$
265$if(height)$
266+
321 height: $height$,
267 height: $height$,
322$endif$
268$endif$
323$if(margin)$
269$if(margin)$
270+
324 // Factor of the display size that should remain empty around the content
271 // Factor of the display size that should remain empty around the content
325 margin: $margin$,
272 margin: $margin$,
326$endif$
273$endif$
327$if(minScale)$
274$if(minScale)$
275+
328 // Bounds for smallest/largest possible scale to apply to content
276 // Bounds for smallest/largest possible scale to apply to content
329 minScale: $minScale$,
277 minScale: $minScale$,
330$endif$
278$endif$
331$if(maxScale)$
279$if(maxScale)$
280+
332 maxScale: $maxScale$,
281 maxScale: $maxScale$,
333$endif$
282$endif$
334−$if(zoomKey)$
335− // Modifier key used to click-zoom to part of the slide
336− zoomKey: '$zoomKey$',
337−$endif$
338−$if(display)$
339− // The display mode that will be used to show slides
340− display: '$display$',
341−$endif$
342$if(mathjax)$
283$if(mathjax)$
284+
343 math: {
285 math: {
344 mathjax: '$mathjaxurl$',
286 mathjax: '$mathjaxurl$',
345 config: 'TeX-AMS_HTML-full',
287 config: 'TeX-AMS_HTML-full',
data/templates/styles.html+2−1
@@ -14,7 +14,7 @@ body {
14 padding-top: $if(margin-top)$$margin-top$$else$50px$endif$;
14 padding-top: $if(margin-top)$$margin-top$$else$50px$endif$;
15 padding-bottom: $if(margin-bottom)$$margin-bottom$$else$50px$endif$;
15 padding-bottom: $if(margin-bottom)$$margin-bottom$$else$50px$endif$;
16 hyphens: auto;
16 hyphens: auto;
17− word-wrap: break-word;
17+ overflow-wrap: break-word;
18 text-rendering: optimizeLegibility;
18 text-rendering: optimizeLegibility;
19 font-kerning: normal;
19 font-kerning: normal;
20}
20}
@@ -93,6 +93,7 @@ $endif$
93pre code {
93pre code {
94 padding: 0;
94 padding: 0;
95 overflow: visible;
95 overflow: visible;
96+ overflow-wrap: normal;
96}
97}
97.sourceCode {
98.sourceCode {
98 background-color: transparent;
99 background-color: transparent;
doc/epub.md+9−2
@@ -141,8 +141,15 @@ Pandoc has an EPUB3 writer. It renders LaTeX math into MathML, which
141EPUB3 readers are supposed to support (but unfortunately few do).
141EPUB3 readers are supposed to support (but unfortunately few do).
142
142
143Of course, this isn't much help if you want EPUB2 output (`pandoc -t epub2`)
143Of course, this isn't much help if you want EPUB2 output (`pandoc -t epub2`)
144−or target readers that don't support MathML. Then you should try using the
144+or target readers that don't support MathML. Then you have two options:
145+
146+1. Use the [`--webtex`](https://pandoc.org/MANUAL.html#option--webtex) option,
145−`--webtex` option, which will use a web service to convert the TeX to an image.
147+ which will use a web service to convert the TeX to an image.
148+2. Use the [`--gladtex`](https://pandoc.org/MANUAL.html#option--gladtex) option
149+ to convert maths into SVG images on your local machine.
150+
151+Both GladTeX and WebTeX add the LaTeX source of the formula as alternative text
152+of the image, increasing accessibility for blind users.
146
153
147[KindleGen]: https://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000765211
154[KindleGen]: https://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000765211
148[EPUB]: https://en.wikipedia.org/wiki/EPUB
155[EPUB]: https://en.wikipedia.org/wiki/EPUB
doc/faqs.mdnew file+128
@@ -0,0 +1,128 @@
1+% FAQs
2+
3+::: faqs
4+
5+## How can I convert a whole directory of files from Markdown to RTF?
6+
7+On linux or OSX:
8+
9+ for f in *.txt; do pandoc "$f" -s -o "${f%.txt}.rtf"; done
10+
11+
12+In Windows Powershell:
13+
14+ gci -r -i *.txt |foreach{$rtf=$_.directoryname+"\"+$_.basename+".rtf";pandoc -f markdown -s $_.name -o $rtf}
15+
16+## I used pandoc to convert a document to ICML (or OPML or RTF), and when I try to open it I'm told it's invalid. What have I done wrong?
17+
18+Be sure to use the `-s` or `--standalone` flag, or you just get a
19+fragment, not a full document with the required header:
20+
21+ pandoc -s -f markdown -t icml -o my.icml my.md
22+
23+## I get a blank document when I try to convert a markdown document in Chinese to PDF.
24+
25+By default, pandoc uses pdflatex to generate the PDF, and pdflatex
26+doesn't handle Chinese characters. But you can change the default to
27+use xelatex instead. You should also make sure you're using a font
28+with Chinese glyphs. For example:
29+
30+ pandoc -o c.pdf --pdf-engine=xelatex -V mainfont='Adobe Ming Std'
31+
32+## The Windows installer does a single user install, rather than installing pandoc for all users. How can I install pandoc for all users?
33+
34+Run the following command as admin:
35+
36+ msiexec /i pandoc-VERSION.msi ALLUSERS=1
37+
38+This will put pandoc in `C:\Program Files\Pandoc`.
39+You can install Pandoc to a different directory by setting APPLICATIONFOLDER parameter,
40+for example:
41+
42+ msiexec /i pandoc-1.11.1.msi ALLUSERS=1 APPLICATIONFOLDER="C:\Pandoc"
43+
44+## How do I change the margins in PDF output?
45+
46+The option
47+
48+ -V geometry:margin=1in
49+
50+will set the margins to one inch on each side. If you don't want uniform
51+margins, you can do something like
52+
53+ -V geometry:"top=2cm, bottom=1.5cm, left=1cm, right=1cm"
54+
55+Or
56+
57+ -V geometry:"left=3cm, width=10cm"
58+
59+For more options, see the documentation for the LaTeX [geometry
60+package](https://www.ctan.org/pkg/geometry).
61+
62+## How does pandoc compare to multimarkdown?
63+
64+Here is a [wiki
65+page](https://github.com/jgm/pandoc/wiki/Pandoc-vs-Multimarkdown)
66+comparing the two.
67+
68+## When I specify an image width of 50% and convert to LaTeX, pandoc sets the height to textheight and the aspect ratio isn't preserved. How can I prevent this?
69+
70+For example, if you convert an image with `{width="50%"}`, the LaTeX produced
71+will be `\includegraphics[width=0.5\textwidth,height=\textheight]`.
72+
73+This output presupposes the following code in pandoc's default latex
74+template:
75+
76+```
77+% Scale images if necessary, so that they will not overflow the page
78+% margins by default, and it is still possible to overwrite the defaults
79+% using explicit options in \includegraphics[width, height, ...]{}
80+\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
81+```
82+
83+If you don't have this in your custom template, you should
84+add it. If we didn't set the `height` explicitly in this way,
85+the image would not be resized correctly unless it was
86+being resized to smaller than its original size.
87+
88+## Pandoc sometimes uses too much memory. How can I limit the memory used by pandoc?
89+
90+`pandoc +RTS -M30m -RTS` will limit heap memory to 30MB.
91+When converting a document requires more than this, an out of
92+memory error will be issued.
93+
94+## When using `--include-in-header` with PDF or LaTeX output, how do I reference tex declarations coming after `$header-includes$` in the default template?
95+
96+For various reasons, the `$header-includes$` are not at the very
97+end of the LaTeX preamble. This poses a problem when the code
98+you are inserting depends on declarations in the preamble coming
99+after the `$header-includes$` location. For example, you might
100+want to reference the `\author` and `\title` metadata values
101+(set at the very bottom of the preamble) and present them in
102+margins. In that case you can wrap your code in `etoolbox`'s
103+`\AtEndPreamble`. The technique is demonstrated in [this
104+gist](https://gist.github.com/JohnLukeBentley/9dda6166b9ee5c4127afd2b8cd16b70a).
105+When using `\AtEndPreamble`, keep any `makeatletter` or
106+`makeatother` outside of the `\AtEndPreamble`, as shown in the
107+example.
108+
109+## How can I convert PDFs to other formats using pandoc?
110+
111+You can't. You can try opening the PDF in Word or Google Docs
112+and saving in a format from which pandoc can convert directly.
113+
114+## Do I really need to install a 1 GB TeX installation to produce a PDF using pandoc?
115+
116+No. You can get by with a relatively small TeX installation,
117+for example, by starting with MacTeX's Basic TeX distribution
118+and using the `tlmgr` tool to install a few packages required by pandoc
119+(see https://pandoc.org/MANUAL.html#creating-a-pdf).
120+
121+Or, you can produce PDFs via HTML and `wkhtmltopdf`,
122+or via groff ms and `pdfroff`. (These don't produce as nice
123+topography as TeX, particularly when it comes to math, but they
124+may be fine for many purposes.)
125+
126+
127+:::
128+
doc/using-the-pandoc-api.md+9−9
@@ -139,7 +139,7 @@ report :: PandocMonad m => LogMessage -> m ()
139-- | Fetch an image or other item from the local filesystem or the net.
139-- | Fetch an image or other item from the local filesystem or the net.
140-- Returns raw content and maybe mime type.
140-- Returns raw content and maybe mime type.
141fetchItem :: PandocMonad m
141fetchItem :: PandocMonad m
142− => String
142+ => Text
143 -> m (B.ByteString, Maybe MimeType)
143 -> m (B.ByteString, Maybe MimeType)
144
144
145-- Set the resource path searched by 'fetchItem'.
145-- Set the resource path searched by 'fetchItem'.
@@ -213,8 +213,8 @@ of the Monoid typeclass and can easily be concatenated:
213import Text.Pandoc.Builder
213import Text.Pandoc.Builder
214
214
215mydoc :: Pandoc
215mydoc :: Pandoc
216−mydoc = doc $ header 1 (text "Hello!")
216+mydoc = doc $ header 1 (text (T.pack "Hello!"))
217− <> para (emph (text "hello world") <> text ".")
217+ <> para (emph (text (T.pack "hello world")) <> text (T.pack "."))
218
218
219main :: IO ()
219main :: IO ()
220main = print mydoc
220main = print mydoc
@@ -261,16 +261,16 @@ import qualified Data.Text as T
261import Data.List (intersperse)
261import Data.List (intersperse)
262
262
263data Station = Station{
263data Station = Station{
264− address :: String
264+ address :: T.Text
265− , name :: String
265+ , name :: T.Text
266− , cardsAccepted :: [String]
266+ , cardsAccepted :: [T.Text]
267 } deriving Show
267 } deriving Show
268
268
269instance FromJSON Station where
269instance FromJSON Station where
270 parseJSON (Object v) = Station <$>
270 parseJSON (Object v) = Station <$>
271 v .: "street_address" <*>
271 v .: "street_address" <*>
272 v .: "station_name" <*>
272 v .: "station_name" <*>
273− (words <$> (v .:? "cards_accepted" .!= ""))
273+ (T.words <$> (v .:? "cards_accepted" .!= ""))
274 parseJSON _ = mzero
274 parseJSON _ = mzero
275
275
276createLetter :: [Station] -> Pandoc
276createLetter :: [Station] -> Pandoc
@@ -328,7 +328,7 @@ users to override the system defaults. If you want to disable
328this behavior, use `setUserDataDir Nothing`.
328this behavior, use `setUserDataDir Nothing`.
329
329
330To render a template, use `renderTemplate'`, which takes two
330To render a template, use `renderTemplate'`, which takes two
331−arguments, a template (String) and a context (any instance
331+arguments, a template (Text) and a context (any instance
332of ToJSON). If you want to create a context from the metadata
332of ToJSON). If you want to create a context from the metadata
333part of a Pandoc document, use `metaToJSON'` from
333part of a Pandoc document, use `metaToJSON'` from
334[Text.Pandoc.Writers.Shared]. If you also want to incorporate
334[Text.Pandoc.Writers.Shared]. If you also want to incorporate
@@ -426,7 +426,7 @@ concatenated together. Here's an example that returns a
426list of the URLs linked to in a document:
426list of the URLs linked to in a document:
427
427
428```haskell
428```haskell
429−listURLs :: Pandoc -> [String]
429+listURLs :: Pandoc -> [Text]
430listURLs = query urls
430listURLs = query urls
431 where urls (Link _ _ (src, _)) = [src]
431 where urls (Link _ _ (src, _)) = [src]
432 urls _ = []
432 urls _ = []
man/pandoc.1+20−13
@@ -1,7 +1,7 @@
1'\" t
1'\" t
2−.\" Automatically generated by Pandoc 2.14
2+.\" Automatically generated by Pandoc 2.14.0.1
3.\"
3.\"
4−.TH "Pandoc User\[cq]s Guide" "" "May 31, 2021" "pandoc 2.14.0.1" ""
4+.TH "Pandoc User\[cq]s Guide" "" "June 20, 2021" "pandoc 2.14.0.3" ""
5.hy
5.hy
6.SH NAME
6.SH NAME
7pandoc - general markup converter
7pandoc - general markup converter
@@ -716,11 +716,11 @@ Extract images and other media contained in or linked from the source
716document to the path \f[I]DIR\f[R], creating it if necessary, and adjust
716document to the path \f[I]DIR\f[R], creating it if necessary, and adjust
717the images references in the document so they point to the extracted
717the images references in the document so they point to the extracted
718files.
718files.
719+Media are downloaded, read from the file system, or extracted from a
719−If the source format is a binary container (docx, epub, or odt), the
720+binary container (e.g.\ docx), as needed.
720−media is extracted from the container and the original filenames are
721+The original file paths are used if they are relative paths not
721−used.
722+containing \f[C]..\f[R].
722−Otherwise the media is read from the file system or downloaded, and new
723−filenames are constructed based on SHA1 hashes of the contents.
723+Otherwise filenames are constructed from the SHA1 hash of the contents.
724.TP
724.TP
725\f[B]\f[CB]--abbreviations=\f[B]\f[R]\f[I]FILE\f[R]
725\f[B]\f[CB]--abbreviations=\f[B]\f[R]\f[I]FILE\f[R]
726Specifies a custom abbreviations file, with abbreviations one to a line.
726Specifies a custom abbreviations file, with abbreviations one to a line.
@@ -1504,16 +1504,16 @@ inserted.
1504.TP
1504.TP
1505\f[B]\f[CB]--gladtex\f[B]\f[R]
1505\f[B]\f[CB]--gladtex\f[B]\f[R]
1506Enclose TeX math in \f[C]<eq>\f[R] tags in HTML output.
1506Enclose TeX math in \f[C]<eq>\f[R] tags in HTML output.
1507−The resulting HTML can then be processed by GladTeX to produce images of
1507+The resulting HTML can then be processed by GladTeX to produce SVG
1508−the typeset formulas and an HTML file with links to these images.
1508+images of the typeset formulas and an HTML file with these images
1509−So, the procedure is:
1509+embedded.
1510.RS
1510.RS
1511.IP
1511.IP
1512.nf
1512.nf
1513\f[C]
1513\f[C]
1514pandoc -s --gladtex input.md -o myfile.htex
1514pandoc -s --gladtex input.md -o myfile.htex
1515−gladtex -d myfile-images myfile.htex
1515+gladtex -d image_dir myfile.htex
1516−# produces myfile.html and images in myfile-images
1516+# produces myfile.html and images in image_dir
1517\f[R]
1517\f[R]
1518.fi
1518.fi
1519.RE
1519.RE
@@ -4820,6 +4820,13 @@ abstract: |
4820\f[R]
4820\f[R]
4821.fi
4821.fi
4822.PP
4822.PP
4823+The literal block after the \f[C]|\f[R] must be indented relative to the
4824+line containing the \f[C]|\f[R].
4825+If it is not, the YAML will be invalid and pandoc will not interpret it
4826+as metadata.
4827+For an overview of the complex rules governing YAML, see the Wikipedia
4828+entry on YAML syntax.
4829+.PP
4823Template variables will be set automatically from the metadata.
4830Template variables will be set automatically from the metadata.
4824Thus, for example, in writing HTML, the variable \f[C]abstract\f[R] will
4831Thus, for example, in writing HTML, the variable \f[C]abstract\f[R] will
4825be set to the HTML equivalent of the Markdown in the \f[C]abstract\f[R]
4832be set to the HTML equivalent of the Markdown in the \f[C]abstract\f[R]
@@ -7701,7 +7708,7 @@ The HTML generated by pandoc is not guaranteed to be safe.
7701If \f[C]raw_html\f[R] is enabled for the Markdown input, users can
7708If \f[C]raw_html\f[R] is enabled for the Markdown input, users can
7702inject arbitrary HTML.
7709inject arbitrary HTML.
7703Even if \f[C]raw_html\f[R] is disabled, users can include dangerous
7710Even if \f[C]raw_html\f[R] is disabled, users can include dangerous
7704−content in attributes for headings, spans, and code blocks.
7711+content in URLs and attributes.
7705To be safe, you should run all the generated HTML through an HTML
7712To be safe, you should run all the generated HTML through an HTML
7706sanitizer.
7713sanitizer.
7707.SH AUTHORS
7714.SH AUTHORS
pandoc.cabal+5−5
@@ -1,6 +1,6 @@
1cabal-version: 2.2
1cabal-version: 2.2
2name: pandoc
2name: pandoc
3−version: 2.14.0.1
3+version: 2.14.0.3
4build-type: Simple
4build-type: Simple
5license: GPL-2.0-or-later
5license: GPL-2.0-or-later
6license-file: COPYING.md
6license-file: COPYING.md
@@ -451,9 +451,9 @@ library
451 bytestring >= 0.9 && < 0.12,
451 bytestring >= 0.9 && < 0.12,
452 case-insensitive >= 1.2 && < 1.3,
452 case-insensitive >= 1.2 && < 1.3,
453 citeproc >= 0.4.0.1 && < 0.4.1,
453 citeproc >= 0.4.0.1 && < 0.4.1,
454− commonmark >= 0.2 && < 0.3,
454+ commonmark >= 0.2.1 && < 0.3,
455 commonmark-extensions >= 0.2.1.2 && < 0.3,
455 commonmark-extensions >= 0.2.1.2 && < 0.3,
456− commonmark-pandoc >= 0.2.1 && < 0.3,
456+ commonmark-pandoc >= 0.2.1.1 && < 0.3,
457 connection >= 0.3.1,
457 connection >= 0.3.1,
458 containers >= 0.4.2.1 && < 0.7,
458 containers >= 0.4.2.1 && < 0.7,
459 data-default >= 0.4 && < 0.8,
459 data-default >= 0.4 && < 0.8,
@@ -484,8 +484,8 @@ library
484 random >= 1 && < 1.3,
484 random >= 1 && < 1.3,
485 safe >= 0.3.18 && < 0.4,
485 safe >= 0.3.18 && < 0.4,
486 scientific >= 0.3 && < 0.4,
486 scientific >= 0.3 && < 0.4,
487− skylighting >= 0.10.5.1 && < 0.10.6,
487+ skylighting >= 0.10.5.2 && < 0.10.6,
488− skylighting-core >= 0.10.5.1 && < 0.10.6,
488+ skylighting-core >= 0.10.5.2 && < 0.10.6,
489 split >= 0.2 && < 0.3,
489 split >= 0.2 && < 0.3,
490 syb >= 0.1 && < 0.8,
490 syb >= 0.1 && < 0.8,
491 tagsoup >= 0.14.6 && < 0.15,
491 tagsoup >= 0.14.6 && < 0.15,
src/Text/Pandoc/Citeproc.hs+67−41
@@ -27,7 +27,7 @@ import Text.Pandoc.Error (PandocError(..))
27import Text.Pandoc.Extensions (pandocExtensions)
27import Text.Pandoc.Extensions (pandocExtensions)
28import Text.Pandoc.Logging (LogMessage(..))
28import Text.Pandoc.Logging (LogMessage(..))
29import Text.Pandoc.Options (ReaderOptions(..))
29import Text.Pandoc.Options (ReaderOptions(..))
30−import Text.Pandoc.Shared (stringify, ordNub, blocksToInlines, tshow)
30+import Text.Pandoc.Shared (stringify, ordNub, tshow)
31import qualified Text.Pandoc.UTF8 as UTF8
31import qualified Text.Pandoc.UTF8 as UTF8
32import Text.Pandoc.Walk (query, walk, walkM)
32import Text.Pandoc.Walk (query, walk, walkM)
33import Control.Applicative ((<|>))
33import Control.Applicative ((<|>))
@@ -91,22 +91,18 @@ processCitations (Pandoc meta bs) = do
91 walk (convertQuotes locale) .
91 walk (convertQuotes locale) .
92 insertSpace $ out)
92 insertSpace $ out)
93 (resultBibliography result)
93 (resultBibliography result)
94− let moveNotes = maybe True truish $
94+ let moveNotes = styleIsNoteStyle sopts &&
95− lookupMeta "notes-after-punctuation" meta
95+ maybe True truish (lookupMeta "notes-after-punctuation" meta)
96 let cits = map (walk (convertQuotes locale)) $
96 let cits = map (walk (convertQuotes locale)) $
97 resultCitations result
97 resultCitations result
98
98
99− let fixQuotes = case localePunctuationInQuote locale of
100− Just True ->
101− B.toList . movePunctuationInsideQuotes . B.fromList
102− _ -> id
103−
104 let metanocites = lookupMeta "nocite" meta
99 let metanocites = lookupMeta "nocite" meta
105 let Pandoc meta'' bs' =
100 let Pandoc meta'' bs' =
106 maybe id (setMeta "nocite") metanocites .
101 maybe id (setMeta "nocite") metanocites .
107− walk (map capitalizeNoteCitation .
108− fixQuotes . mvPunct moveNotes locale) .
102+ walk (mvPunct moveNotes locale) .
103+ (if styleIsNoteStyle sopts
109− walk deNote .
104+ then walk addNote . walk deNote
105+ else id) .
110 evalState (walkM insertResolvedCitations $ Pandoc meta' bs)
106 evalState (walkM insertResolvedCitations $ Pandoc meta' bs)
111 $ cits
107 $ cits
112 return $ Pandoc meta''
108 return $ Pandoc meta''
@@ -195,7 +191,9 @@ getReferences mblocale (Pandoc meta bs) = do
195 then const True
191 then const True
196 else (`Set.member` citeIds)
192 else (`Set.member` citeIds)
197 let inlineRefs = case lookupMeta "references" meta of
193 let inlineRefs = case lookupMeta "references" meta of
194+ Just (MetaList rs) ->
195+ filter (idpred . unItemId . referenceId)
198− Just (MetaList rs) -> mapMaybe metaValueToReference rs
196+ $ mapMaybe metaValueToReference rs
199 _ -> []
197 _ -> []
200 externalRefs <- case lookupMeta "bibliography" meta of
198 externalRefs <- case lookupMeta "bibliography" meta of
201 Just (MetaList xs) ->
199 Just (MetaList xs) ->
@@ -374,7 +372,6 @@ formatFromExtension fp = case dropWhile (== '.') $ takeExtension fp of
374
372
375
373
376isNote :: Inline -> Bool
374isNote :: Inline -> Bool
377−isNote (Note _) = True
378isNote (Cite _ [Note _]) = True
375isNote (Cite _ [Note _]) = True
379 -- the following allows citation styles that are "in-text" but use superscript
376 -- the following allows citation styles that are "in-text" but use superscript
380 -- references to be treated as if they are "notes" for the purposes of moving
377 -- references to be treated as if they are "notes" for the purposes of moving
@@ -387,6 +384,12 @@ isSpacy Space = True
387isSpacy SoftBreak = True
384isSpacy SoftBreak = True
388isSpacy _ = False
385isSpacy _ = False
389
386
387+movePunctInsideQuotes :: Locale -> [Inline] -> [Inline]
388+movePunctInsideQuotes locale
389+ | localePunctuationInQuote locale == Just True
390+ = B.toList . movePunctuationInsideQuotes . B.fromList
391+ | otherwise
392+ = id
390
393
391mvPunct :: Bool -> Locale -> [Inline] -> [Inline]
394mvPunct :: Bool -> Locale -> [Inline] -> [Inline]
392mvPunct moveNotes locale (x : xs)
395mvPunct moveNotes locale (x : xs)
@@ -399,7 +402,8 @@ mvPunct moveNotes locale (q : s : x : ys)
399 in if moveNotes
402 in if moveNotes
400 then if T.null spunct
403 then if T.null spunct
401 then q : x : mvPunct moveNotes locale ys
404 then q : x : mvPunct moveNotes locale ys
405+ else movePunctInsideQuotes locale
402− else q : Str spunct : x : mvPunct moveNotes locale
406+ [q , Str spunct , x] ++ mvPunct moveNotes locale
403 (B.toList
407 (B.toList
404 (dropTextWhile isPunctuation (B.fromList ys)))
408 (dropTextWhile isPunctuation (B.fromList ys)))
405 else q : x : mvPunct moveNotes locale ys
409 else q : x : mvPunct moveNotes locale ys
@@ -411,9 +415,10 @@ mvPunct moveNotes locale (Cite cs ils : ys)
411 , moveNotes
415 , moveNotes
412 = let s = stringify ys
416 = let s = stringify ys
413 spunct = T.takeWhile isPunctuation s
417 spunct = T.takeWhile isPunctuation s
418+ in Cite cs (movePunctInsideQuotes locale $
414− in Cite cs (init ils
419+ init ils
415− ++ [Str spunct | not (endWithPunct False (init ils))]
420+ ++ [Str spunct | not (endWithPunct False (init ils))]
416− ++ [last ils]) :
421+ ++ [last ils]) :
417 mvPunct moveNotes locale
422 mvPunct moveNotes locale
418 (B.toList (dropTextWhile isPunctuation (B.fromList ys)))
423 (B.toList (dropTextWhile isPunctuation (B.fromList ys)))
419mvPunct moveNotes locale (s : x : ys) | isSpacy s, isNote x =
424mvPunct moveNotes locale (s : x : ys) | isSpacy s, isNote x =
@@ -499,7 +504,8 @@ insertRefs refkvs refclasses meta refs bs =
499 put True
504 put True
500 -- refHeader isn't used if you have an explicit references div
505 -- refHeader isn't used if you have an explicit references div
501 let cs' = ordNub $ cs ++ refclasses
506 let cs' = ordNub $ cs ++ refclasses
507+ let kvs' = ordNub $ kvs ++ refkvs
502− return $ Div ("refs",cs' ++ refclasses,kvs ++ refkvs) (xs ++ refs)
508+ return $ Div ("refs",cs',kvs') (xs ++ refs)
503 go x = return x
509 go x = return x
504
510
505refTitle :: Meta -> Maybe [Inline]
511refTitle :: Meta -> Maybe [Inline]
@@ -558,42 +564,62 @@ extractText (FancyVal x) = toText x
558extractText (NumVal n) = T.pack (show n)
564extractText (NumVal n) = T.pack (show n)
559extractText _ = mempty
565extractText _ = mempty
560
566
567+-- Here we take the Spans with class csl-note that are left
568+-- after deNote has removed nested ones, and convert them
569+-- into real notes.
561−capitalizeNoteCitation :: Inline -> Inline
570+addNote :: Inline -> Inline
562−capitalizeNoteCitation (Cite cs [Note [Para ils]]) =
571+addNote (Span ("",["csl-note"],[]) ils) =
563− Cite cs
572+ Note [Para $
564− [Note [Para $ B.toList $ addTextCase Nothing CapitalizeFirst
573+ B.toList . addTextCase Nothing CapitalizeFirst . B.fromList $ ils]
565− $ B.fromList ils]]
574+addNote x = x
566−capitalizeNoteCitation x = x
575+
567−
576+-- Here we handle citation notes that occur inside footnotes
577+-- or other citation notes, in a note style. We don't want
578+-- notes inside notes, so we convert these to parenthesized
579+-- or comma-separated citations.
568−deNote :: [Inline] -> [Inline]
580+deNote :: Inline -> Inline
569−deNote [] = []
581+deNote (Note bs) =
570−deNote (Note bs:rest) =
582+ case bs of
571− Note (walk go bs) : deNote rest
583+ [Para (cit@(Cite (c:_) _) : ils)]
584+ | citationMode c /= AuthorInText ->
585+ -- if citation is first in note, no need to parenthesize.
586+ Note [Para (walk removeNotes $ cit : walk addParens ils)]
587+ _ -> Note (walk removeNotes . walk addParens $ bs)
588+
572 where
589 where
573− go [] = []
590+ addParens [] = []
574− go (Cite (c:cs) ils : zs)
591+ addParens (Cite (c:cs) ils : zs)
575 | citationMode c == AuthorInText
592 | citationMode c == AuthorInText
576− = Cite (c:cs) (concatMap (noteAfterComma (needsPeriod zs)) ils) : go zs
593+ = Cite (c:cs) (concatMap (noteAfterComma (needsPeriod zs)) ils) :
594+ addParens zs
577 | otherwise
595 | otherwise
578− = Cite (c:cs) (concatMap noteInParens ils) : go zs
596+ = Cite (c:cs) (concatMap noteInParens ils) : addParens zs
579− go (x:xs) = x : go xs
597+ addParens (x:xs) = x : addParens xs
598+
599+ removeNotes (Span ("",["csl-note"],[]) ils) = Span ("",[],[]) ils
600+ removeNotes x = x
601+
580 needsPeriod [] = True
602 needsPeriod [] = True
581 needsPeriod (Str t:_) = case T.uncons t of
603 needsPeriod (Str t:_) = case T.uncons t of
582 Nothing -> False
604 Nothing -> False
583 Just (c,_) -> isUpper c
605 Just (c,_) -> isUpper c
584 needsPeriod (Space:zs) = needsPeriod zs
606 needsPeriod (Space:zs) = needsPeriod zs
585 needsPeriod _ = False
607 needsPeriod _ = False
608+
586− noteInParens (Note bs')
609+ noteInParens (Span ("",["csl-note"],[]) ils)
587 = Space : Str "(" :
610 = Space : Str "(" :
588− removeFinalPeriod (blocksToInlines bs') ++ [Str ")"]
611+ removeFinalPeriod ils ++ [Str ")"]
589 noteInParens x = [x]
612 noteInParens x = [x]
613+
590− noteAfterComma needsPer (Note bs')
614+ noteAfterComma needsPer (Span ("",["csl-note"],[]) ils)
615+ | not (null ils)
591 = Str "," : Space :
616 = Str "," : Space :
592− (if needsPer
617+ if needsPer
593− then id
618+ then ils
594− else removeFinalPeriod) (blocksToInlines bs')
619+ else removeFinalPeriod ils
595 noteAfterComma _ x = [x]
620 noteAfterComma _ x = [x]
621+
596−deNote (x:xs) = x : deNote xs
622+deNote x = x
597
623
598-- Note: we can't use dropTextWhileEnd indiscriminately,
624-- Note: we can't use dropTextWhileEnd indiscriminately,
599-- because this would remove the final period on abbreviations like Ibid.
625-- because this would remove the final period on abbreviations like Ibid.
src/Text/Pandoc/Citeproc/BibTeX.hs+4−2
@@ -71,9 +71,11 @@ readBibtexString variant locale idpred contents = do
71 filter (\item -> idpred (identifier item) &&
71 filter (\item -> idpred (identifier item) &&
72 entryType item /= "xdata"))
72 entryType item /= "xdata"))
73 (fromMaybe defaultLang $ localeLanguage locale, Map.empty)
73 (fromMaybe defaultLang $ localeLanguage locale, Map.empty)
74− "" (toSources contents) of
74+ (initialSourceName sources) sources of
75 Left err -> Left err
75 Left err -> Left err
76 Right xs -> return xs
76 Right xs -> return xs
77+ where
78+ sources = toSources contents
77
79
78-- | Write BibTeX or BibLaTeX given given a 'Reference'.
80-- | Write BibTeX or BibLaTeX given given a 'Reference'.
79writeBibtexString :: WriterOptions -- ^ options (for writing LaTex)
81writeBibtexString :: WriterOptions -- ^ options (for writing LaTex)
@@ -866,7 +868,7 @@ fieldName = resolveAlias . T.toLower
866
868
867isBibtexKeyChar :: Char -> Bool
869isBibtexKeyChar :: Char -> Bool
868isBibtexKeyChar c =
870isBibtexKeyChar c =
869− isAlphaNum c || c `elem` (".:;?!`'()/*@_+=-[]*&" :: [Char])
871+ isAlphaNum c || c `elem` (".:;?!`'()$/*@_+=-[]*&" :: [Char])
870
872
871bibItem :: BibParser Item
873bibItem :: BibParser Item
872bibItem = do
874bibItem = do
src/Text/Pandoc/Class/IO.hs+21−20
@@ -62,7 +62,7 @@ import Text.Pandoc.Definition (Pandoc, Inline (Image))
62import Text.Pandoc.Error (PandocError (..))
62import Text.Pandoc.Error (PandocError (..))
63import Text.Pandoc.Logging (LogMessage (..), messageVerbosity, showLogMessage)
63import Text.Pandoc.Logging (LogMessage (..), messageVerbosity, showLogMessage)
64import Text.Pandoc.MIME (MimeType)
64import Text.Pandoc.MIME (MimeType)
65−import Text.Pandoc.MediaBag (MediaBag, MediaItem(..), lookupMedia, mediaDirectory)
65+import Text.Pandoc.MediaBag (MediaBag, MediaItem(..), lookupMedia, mediaItems)
66import Text.Pandoc.Walk (walk)
66import Text.Pandoc.Walk (walk)
67import qualified Control.Exception as E
67import qualified Control.Exception as E
68import qualified Data.ByteString as B
68import qualified Data.ByteString as B
@@ -200,31 +200,32 @@ alertIndent (l:ls) = do
200extractMedia :: (PandocMonad m, MonadIO m) => FilePath -> Pandoc -> m Pandoc
200extractMedia :: (PandocMonad m, MonadIO m) => FilePath -> Pandoc -> m Pandoc
201extractMedia dir d = do
201extractMedia dir d = do
202 media <- getMediaBag
202 media <- getMediaBag
203− case [fp | (fp, _, _) <- mediaDirectory media] of
203+ let items = mediaItems media
204+ if null items
204− [] -> return d
205+ then return d
205− fps -> do
206+ else do
206− mapM_ (writeMedia dir media) fps
207+ mapM_ (writeMedia dir) items
207− return $ walk (adjustImagePath dir fps) d
208+ return $ walk (adjustImagePath dir media) d
208
209
209-- | Write the contents of a media bag to a path.
210-- | Write the contents of a media bag to a path.
210writeMedia :: (PandocMonad m, MonadIO m)
211writeMedia :: (PandocMonad m, MonadIO m)
211− => FilePath -> MediaBag -> FilePath
212+ => FilePath
213+ -> (FilePath, MimeType, BL.ByteString)
212 -> m ()
214 -> m ()
213−writeMedia dir mediabag subpath = do
215+writeMedia dir (fp, _mt, bs) = do
214− let mbcontents = lookupMedia subpath mediabag
215− case mbcontents of
216− Nothing -> throwError $ PandocResourceNotFound $ pack subpath
217− Just item -> do
218− -- we normalize to get proper path separators for the platform
216+ -- we normalize to get proper path separators for the platform
219− let fullpath = dir </> normalise (mediaPath item)
217+ let fullpath = normalise $ dir </> fp
220− liftIOError (createDirectoryIfMissing True) (takeDirectory fullpath)
218+ liftIOError (createDirectoryIfMissing True) (takeDirectory fullpath)
221− logIOError $ BL.writeFile fullpath $ mediaContents item
219+ logIOError $ BL.writeFile fullpath bs
222
220
223-- | If the given Inline element is an image with a @src@ path equal to
221-- | If the given Inline element is an image with a @src@ path equal to
224-- one in the list of @paths@, then prepends @dir@ to the image source;
222-- one in the list of @paths@, then prepends @dir@ to the image source;
225-- returns the element unchanged otherwise.
223-- returns the element unchanged otherwise.
226−adjustImagePath :: FilePath -> [FilePath] -> Inline -> Inline
224+adjustImagePath :: FilePath -> MediaBag -> Inline -> Inline
227−adjustImagePath dir paths (Image attr lab (src, tit))
225+adjustImagePath dir mediabag (Image attr lab (src, tit)) =
228− | unpack src `elem` paths
226+ case lookupMedia (T.unpack src) mediabag of
227+ Nothing -> Image attr lab (src, tit)
228+ Just item ->
229+ let fullpath = dir </> mediaPath item
229− = Image attr lab (pack (normalise $ dir </> unpack src), tit)
230+ in Image attr lab (T.pack fullpath, tit)
230adjustImagePath _ _ x = x
231adjustImagePath _ _ x = x
src/Text/Pandoc/Class/PandocMonad.hs+6−11
@@ -638,17 +638,12 @@ fillMediaBag d = walkM handleImage d
638 handleImage (Image attr lab (src, tit)) = catchError
638 handleImage (Image attr lab (src, tit)) = catchError
639 (do mediabag <- getMediaBag
639 (do mediabag <- getMediaBag
640 let fp = T.unpack src
640 let fp = T.unpack src
641− src' <- T.pack <$> case lookupMedia fp mediabag of
641+ case lookupMedia fp mediabag of
642− Just item -> return $ mediaPath item
642+ Just _ -> return ()
643− Nothing -> do
643+ Nothing -> do
644− (bs, mt) <- fetchItem src
644+ (bs, mt) <- fetchItem src
645− insertMedia fp mt (BL.fromStrict bs)
645+ insertMedia fp mt (BL.fromStrict bs)
646− mediabag' <- getMediaBag
647− case lookupMedia fp mediabag' of
648− Just item -> return $ mediaPath item
649− Nothing -> throwError $ PandocSomeError $
650− src <> " not successfully inserted into MediaBag"
651− return $ Image attr lab (src', tit))
646+ return $ Image attr lab (src, tit))
652 (\e ->
647 (\e ->
653 case e of
648 case e of
654 PandocResourceNotFound _ -> do
649 PandocResourceNotFound _ -> do
src/Text/Pandoc/Error.hs+3−3
@@ -97,13 +97,13 @@ renderError e =
97 [] -> ""
97 [] -> ""
98 ((pos,txt):_) ->
98 ((pos,txt):_) ->
99 let ls = T.lines txt <> [""]
99 let ls = T.lines txt <> [""]
100− ln = errLine - sourceLine pos
100+ ln = (errLine - sourceLine pos) + 1
101− in if length ls > ln - 1
101+ in if length ls > ln && ln >= 1
102 then T.concat ["\n", ls !! (ln - 1)
102 then T.concat ["\n", ls !! (ln - 1)
103 ,"\n", T.replicate (errColumn - 1) " "
103 ,"\n", T.replicate (errColumn - 1) " "
104 ,"^"]
104 ,"^"]
105 else ""
105 else ""
106− in "\nError at " <> tshow err' <> errorInFile
106+ in "Error at " <> tshow err' <> errorInFile
107 PandocMakePDFError s -> s
107 PandocMakePDFError s -> s
108 PandocOptionError s -> s
108 PandocOptionError s -> s
109 PandocSyntaxMapError s -> s
109 PandocSyntaxMapError s -> s
src/Text/Pandoc/ImageSize.hs+5−1
@@ -57,7 +57,8 @@ import Codec.Picture (decodeImageWithMetadata)
57-- quick and dirty functions to get image sizes
57-- quick and dirty functions to get image sizes
58-- algorithms borrowed from wwwis.pl
58-- algorithms borrowed from wwwis.pl
59
59
60−data ImageType = Png | Gif | Jpeg | Svg | Pdf | Eps | Emf deriving Show
60+data ImageType = Png | Gif | Jpeg | Svg | Pdf | Eps | Emf | Tiff
61+ deriving Show
61data Direction = Width | Height
62data Direction = Width | Height
62instance Show Direction where
63instance Show Direction where
63 show Width = "width"
64 show Width = "width"
@@ -100,6 +101,8 @@ imageType :: ByteString -> Maybe ImageType
100imageType img = case B.take 4 img of
101imageType img = case B.take 4 img of
101 "\x89\x50\x4e\x47" -> return Png
102 "\x89\x50\x4e\x47" -> return Png
102 "\x47\x49\x46\x38" -> return Gif
103 "\x47\x49\x46\x38" -> return Gif
104+ "\x49\x49\x2a\x00" -> return Tiff
105+ "\x4D\x4D\x00\x2a" -> return Tiff
103 "\xff\xd8\xff\xe0" -> return Jpeg -- JFIF
106 "\xff\xd8\xff\xe0" -> return Jpeg -- JFIF
104 "\xff\xd8\xff\xe1" -> return Jpeg -- Exif
107 "\xff\xd8\xff\xe1" -> return Jpeg -- Exif
105 "%PDF" -> return Pdf
108 "%PDF" -> return Pdf
@@ -124,6 +127,7 @@ imageSize opts img = checkDpi <$>
124 Just Png -> getSize img
127 Just Png -> getSize img
125 Just Gif -> getSize img
128 Just Gif -> getSize img
126 Just Jpeg -> getSize img
129 Just Jpeg -> getSize img
130+ Just Tiff -> getSize img
127 Just Svg -> mbToEither "could not determine SVG size" $ svgSize opts img
131 Just Svg -> mbToEither "could not determine SVG size" $ svgSize opts img
128 Just Eps -> mbToEither "could not determine EPS size" $ epsSize img
132 Just Eps -> mbToEither "could not determine EPS size" $ epsSize img
129 Just Pdf -> mbToEither "could not determine PDF size" $ pdfSize img
133 Just Pdf -> mbToEither "could not determine PDF size" $ pdfSize img
src/Text/Pandoc/Lua/Module/Utils.hs+1−1
@@ -146,7 +146,7 @@ from_simple_table (SimpleTable capt aligns widths head' body) = do
146 nullAttr
146 nullAttr
147 (Caption Nothing [Plain capt])
147 (Caption Nothing [Plain capt])
148 (zipWith (\a w -> (a, toColWidth w)) aligns widths)
148 (zipWith (\a w -> (a, toColWidth w)) aligns widths)
149− (TableHead nullAttr [blockListToRow head'])
149+ (TableHead nullAttr [blockListToRow head' | not (null head') ])
150 [TableBody nullAttr 0 [] $ map blockListToRow body]
150 [TableBody nullAttr 0 [] $ map blockListToRow body]
151 (TableFoot nullAttr [])
151 (TableFoot nullAttr [])
152 return (NumResults 1)
152 return (NumResults 1)
src/Text/Pandoc/MIME.hs+10
@@ -43,6 +43,16 @@ getMimeTypeDef :: FilePath -> MimeType
43getMimeTypeDef = fromMaybe "application/octet-stream" . getMimeType
43getMimeTypeDef = fromMaybe "application/octet-stream" . getMimeType
44
44
45extensionFromMimeType :: MimeType -> Maybe T.Text
45extensionFromMimeType :: MimeType -> Maybe T.Text
46+-- few special cases, where there are multiple options:
47+extensionFromMimeType "text/plain" = Just "txt"
48+extensionFromMimeType "video/quicktime" = Just "mov"
49+extensionFromMimeType "video/mpeg" = Just "mpeg"
50+extensionFromMimeType "video/dv" = Just "dv"
51+extensionFromMimeType "image/vnd.djvu" = Just "djvu"
52+extensionFromMimeType "image/tiff" = Just "tiff"
53+extensionFromMimeType "image/jpeg" = Just "jpg"
54+extensionFromMimeType "application/xml" = Just "xml"
55+extensionFromMimeType "application/ogg" = Just "ogg"
46extensionFromMimeType mimetype =
56extensionFromMimeType mimetype =
47 M.lookup (T.takeWhile (/=';') mimetype) reverseMimeTypes
57 M.lookup (T.takeWhile (/=';') mimetype) reverseMimeTypes
48 -- note: we just look up the basic mime type, dropping the content-encoding etc.
58 -- note: we just look up the basic mime type, dropping the content-encoding etc.
src/Text/Pandoc/MediaBag.hs+20−12
@@ -26,13 +26,14 @@ module Text.Pandoc.MediaBag (
26import qualified Data.ByteString.Lazy as BL
26import qualified Data.ByteString.Lazy as BL
27import Data.Data (Data)
27import Data.Data (Data)
28import qualified Data.Map as M
28import qualified Data.Map as M
29−import Data.Maybe (fromMaybe)
29+import Data.Maybe (fromMaybe, isNothing)
30import Data.Typeable (Typeable)
30import Data.Typeable (Typeable)
31import System.FilePath
31import System.FilePath
32import Text.Pandoc.MIME (MimeType, getMimeTypeDef, extensionFromMimeType)
32import Text.Pandoc.MIME (MimeType, getMimeTypeDef, extensionFromMimeType)
33import Data.Text (Text)
33import Data.Text (Text)
34import qualified Data.Text as T
34import qualified Data.Text as T
35import Data.Digest.Pure.SHA (sha1, showDigest)
35import Data.Digest.Pure.SHA (sha1, showDigest)
36+import Network.URI (URI (..), parseURI)
36
37
37data MediaItem =
38data MediaItem =
38 MediaItem
39 MediaItem
@@ -71,16 +72,25 @@ insertMedia :: FilePath -- ^ relative path and canonical name of resource
71 -> MediaBag
72 -> MediaBag
72 -> MediaBag
73 -> MediaBag
73insertMedia fp mbMime contents (MediaBag mediamap) =
74insertMedia fp mbMime contents (MediaBag mediamap) =
74− MediaBag (M.insert (canonicalize fp) mediaItem mediamap)
75+ MediaBag (M.insert fp' mediaItem mediamap)
75− where mediaItem = MediaItem{ mediaPath = showDigest (sha1 contents) <>
76+ where mediaItem = MediaItem{ mediaPath = newpath
76− "." <> ext
77 , mediaContents = contents
77 , mediaContents = contents
78 , mediaMimeType = mt }
78 , mediaMimeType = mt }
79+ fp' = canonicalize fp
80+ uri = parseURI fp
81+ newpath = if isRelative fp
82+ && isNothing uri
83+ && ".." `notElem` splitPath fp
84+ then T.unpack fp'
85+ else showDigest (sha1 contents) <> "." <> ext
79 fallback = case takeExtension fp of
86 fallback = case takeExtension fp of
80 ".gz" -> getMimeTypeDef $ dropExtension fp
87 ".gz" -> getMimeTypeDef $ dropExtension fp
81 _ -> getMimeTypeDef fp
88 _ -> getMimeTypeDef fp
82 mt = fromMaybe fallback mbMime
89 mt = fromMaybe fallback mbMime
90+ path = maybe fp uriPath uri
91+ ext = case takeExtension path of
92+ '.':e -> e
83− ext = maybe (takeExtension fp) T.unpack $ extensionFromMimeType mt
93+ _ -> maybe "" T.unpack $ extensionFromMimeType mt
84
94
85
95
86-- | Lookup a media item in a 'MediaBag', returning mime type and contents.
96-- | Lookup a media item in a 'MediaBag', returning mime type and contents.
@@ -92,13 +102,11 @@ lookupMedia fp (MediaBag mediamap) = M.lookup (canonicalize fp) mediamap
92-- | Get a list of the file paths stored in a 'MediaBag', with
102-- | Get a list of the file paths stored in a 'MediaBag', with
93-- their corresponding mime types and the lengths in bytes of the contents.
103-- their corresponding mime types and the lengths in bytes of the contents.
94mediaDirectory :: MediaBag -> [(FilePath, MimeType, Int)]
104mediaDirectory :: MediaBag -> [(FilePath, MimeType, Int)]
95−mediaDirectory (MediaBag mediamap) =
105+mediaDirectory mediabag =
96− M.foldrWithKey (\fp item ->
97− ((T.unpack fp, mediaMimeType item,
98− fromIntegral (BL.length (mediaContents item))):)) [] mediamap
106+ map (\(fp, mt, bs) -> (fp, mt, fromIntegral (BL.length bs)))
107+ (mediaItems mediabag)
99
108
100mediaItems :: MediaBag -> [(FilePath, MimeType, BL.ByteString)]
109mediaItems :: MediaBag -> [(FilePath, MimeType, BL.ByteString)]
101mediaItems (MediaBag mediamap) =
110mediaItems (MediaBag mediamap) =
102− M.foldrWithKey (\fp item ->
103− ((T.unpack fp, mediaMimeType item, mediaContents item):))
111+ map (\item -> (mediaPath item, mediaMimeType item, mediaContents item))
104− [] mediamap
112+ (M.elems mediamap)
src/Text/Pandoc/Parsing.hs+4−5
@@ -188,7 +188,7 @@ import Control.Monad.Identity
188import Control.Monad.Reader
188import Control.Monad.Reader
189 ( asks, runReader, MonadReader(ask), Reader, ReaderT(ReaderT) )
189 ( asks, runReader, MonadReader(ask), Reader, ReaderT(ReaderT) )
190import Data.Char (chr, isAlphaNum, isAscii, isAsciiUpper, isAsciiLower,
190import Data.Char (chr, isAlphaNum, isAscii, isAsciiUpper, isAsciiLower,
191− isPunctuation, isSpace, ord, toLower, toUpper)
191+ isSpace, ord, toLower, toUpper)
192import Data.Default ( Default(..) )
192import Data.Default ( Default(..) )
193import Data.Functor (($>))
193import Data.Functor (($>))
194import Data.List (intercalate, transpose)
194import Data.List (intercalate, transpose)
@@ -693,13 +693,12 @@ emailAddress = try $ toResult <$> mailbox <*> (char '@' *> domain)
693 mailbox = intercalate "." <$> (emailWord `sepBy1'` dot)
693 mailbox = intercalate "." <$> (emailWord `sepBy1'` dot)
694 domain = intercalate "." <$> (subdomain `sepBy1'` dot)
694 domain = intercalate "." <$> (subdomain `sepBy1'` dot)
695 dot = char '.'
695 dot = char '.'
696− subdomain = many1 $ alphaNum <|> innerPunct
696+ subdomain = many1 $ alphaNum <|> innerPunct (=='-')
697 -- this excludes some valid email addresses, since an
697 -- this excludes some valid email addresses, since an
698 -- email could contain e.g. '__', but gives better results
698 -- email could contain e.g. '__', but gives better results
699 -- for our purposes, when combined with markdown parsing:
699 -- for our purposes, when combined with markdown parsing:
700− innerPunct = try (satisfy (\c -> isEmailPunct c || c == '@')
700+ innerPunct f = try (satisfy f
701− <* notFollowedBy space
701+ <* notFollowedBy (satisfy (not . isAlphaNum)))
702− <* notFollowedBy (satisfy isPunctuation))
703 -- technically an email address could begin with a symbol,
702 -- technically an email address could begin with a symbol,
704 -- but allowing this creates too many problems.
703 -- but allowing this creates too many problems.
705 -- See e.g. https://github.com/jgm/pandoc/issues/2940
704 -- See e.g. https://github.com/jgm/pandoc/issues/2940
src/Text/Pandoc/Readers/Docx/Parse.hs+11−5
@@ -479,20 +479,26 @@ filePathToRelType path docXmlPath =
479 then Just InDocument
479 then Just InDocument
480 else Nothing
480 else Nothing
481
481
482−relElemToRelationship :: DocumentLocation -> Element -> Maybe Relationship
482+relElemToRelationship :: FilePath -> DocumentLocation -> Element
483+ -> Maybe Relationship
483−relElemToRelationship relType element | qName (elName element) == "Relationship" =
484+relElemToRelationship fp relType element | qName (elName element) == "Relationship" =
484 do
485 do
485 relId <- findAttr (QName "Id" Nothing Nothing) element
486 relId <- findAttr (QName "Id" Nothing Nothing) element
486 target <- findAttr (QName "Target" Nothing Nothing) element
487 target <- findAttr (QName "Target" Nothing Nothing) element
488+ -- target may be relative (media/image1.jpeg) or absolute
489+ -- (/word/media/image1.jpeg); we need to relativize it (see #7374)
490+ let frontOfFp = T.pack $ takeWhile (/= '_') fp
491+ let target' = fromMaybe target $
492+ T.stripPrefix frontOfFp $ T.dropWhile (== '/') target
487− return $ Relationship relType relId target
493+ return $ Relationship relType relId target'
488−relElemToRelationship _ _ = Nothing
494+relElemToRelationship _ _ _ = Nothing
489
495
490filePathToRelationships :: Archive -> FilePath -> FilePath -> [Relationship]
496filePathToRelationships :: Archive -> FilePath -> FilePath -> [Relationship]
491filePathToRelationships ar docXmlPath fp
497filePathToRelationships ar docXmlPath fp
492 | Just relType <- filePathToRelType fp docXmlPath
498 | Just relType <- filePathToRelType fp docXmlPath
493 , Just entry <- findEntryByPath fp ar
499 , Just entry <- findEntryByPath fp ar
494 , Just relElems <- parseXMLFromEntry entry =
500 , Just relElems <- parseXMLFromEntry entry =
495− mapMaybe (relElemToRelationship relType) $ elChildren relElems
501+ mapMaybe (relElemToRelationship fp relType) $ elChildren relElems
496filePathToRelationships _ _ _ = []
502filePathToRelationships _ _ _ = []
497
503
498archiveToRelationships :: Archive -> FilePath -> [Relationship]
504archiveToRelationships :: Archive -> FilePath -> [Relationship]
src/Text/Pandoc/Readers/Metadata.hs+3
@@ -45,6 +45,9 @@ yamlBsToMeta pMetaValue bstr = do
45 Right [] -> return . return $ mempty
45 Right [] -> return . return $ mempty
46 Right [YAML.Doc (YAML.Scalar _ YAML.SNull)]
46 Right [YAML.Doc (YAML.Scalar _ YAML.SNull)]
47 -> return . return $ mempty
47 -> return . return $ mempty
48+ -- the following is what we get from a comment:
49+ Right [YAML.Doc (YAML.Scalar _ (YAML.SUnknown _ ""))]
50+ -> return . return $ mempty
48 Right _ -> Prelude.fail "expected YAML object"
51 Right _ -> Prelude.fail "expected YAML object"
49 Left (yamlpos, err')
52 Left (yamlpos, err')
50 -> do pos <- getPosition
53 -> do pos <- getPosition
src/Text/Pandoc/Readers/Txt2Tags.hs+21−1
@@ -478,9 +478,29 @@ macro = try $ do
478-- raw URLs in text are automatically linked
478-- raw URLs in text are automatically linked
479url :: T2T Inlines
479url :: T2T Inlines
480url = try $ do
480url = try $ do
481− (rawUrl, escapedUrl) <- try uri <|> emailAddress
481+ (rawUrl, escapedUrl) <- try uri <|> emailAddress'
482 return $ B.link rawUrl "" (B.str escapedUrl)
482 return $ B.link rawUrl "" (B.str escapedUrl)
483
483
484+emailAddress' :: T2T (Text, Text)
485+emailAddress' = do
486+ (base, mailURI) <- emailAddress
487+ query <- option "" emailQuery
488+ return (base <> query, mailURI <> query)
489+
490+emailQuery :: T2T Text
491+emailQuery = do
492+ char '?'
493+ parts <- kv `sepBy1` (char '&')
494+ return $ "?" <> T.intercalate "&" parts
495+
496+kv :: T2T Text
497+kv = do
498+ k <- T.pack <$> many1 alphaNum
499+ char '='
500+ let vchar = alphaNum <|> try (oneOf "%._/~:,=$@&+-;*" <* lookAhead alphaNum)
501+ v <- T.pack <$> many1 vchar
502+ return (k <> "=" <> v)
503+
484uri :: T2T (Text, Text)
504uri :: T2T (Text, Text)
485uri = try $ do
505uri = try $ do
486 address <- t2tURI
506 address <- t2tURI
src/Text/Pandoc/Writers/Docx.hs+19−3
@@ -36,7 +36,8 @@ import Data.Time.Clock.POSIX
36import Data.Digest.Pure.SHA (sha1, showDigest)
36import Data.Digest.Pure.SHA (sha1, showDigest)
37import Skylighting
37import Skylighting
38import Text.Collate.Lang (renderLang)
38import Text.Collate.Lang (renderLang)
39−import Text.Pandoc.Class.PandocMonad (PandocMonad, report, toLang)
39+import Text.Pandoc.Class.PandocMonad (PandocMonad, report, toLang, translateTerm)
40+import qualified Text.Pandoc.Translations as Term
40import qualified Text.Pandoc.Class.PandocMonad as P
41import qualified Text.Pandoc.Class.PandocMonad as P
41import Data.Time
42import Data.Time
42import Text.Pandoc.UTF8 (fromTextLazy)
43import Text.Pandoc.UTF8 (fromTextLazy)
@@ -854,14 +855,28 @@ blockToOpenXML' opts (Plain lst) = do
854-- title beginning with fig: indicates that the image is a figure
855-- title beginning with fig: indicates that the image is a figure
855blockToOpenXML' opts (Para [Image attr alt (src,T.stripPrefix "fig:" -> Just tit)]) = do
856blockToOpenXML' opts (Para [Image attr alt (src,T.stripPrefix "fig:" -> Just tit)]) = do
856 setFirstPara
857 setFirstPara
858+ fignum <- gets stNextFigureNum
859+ unless (null alt) $ modify $ \st -> st{ stNextFigureNum = fignum + 1 }
860+ let figid = "fig" <> tshow fignum
861+ figname <- translateTerm Term.Figure
857 prop <- pStyleM $
862 prop <- pStyleM $
858 if null alt
863 if null alt
859 then "Figure"
864 then "Figure"
860 else "Captioned Figure"
865 else "Captioned Figure"
861 paraProps <- local (\env -> env { envParaProperties = EnvProps (Just prop) [] <> envParaProperties env }) (getParaProps False)
866 paraProps <- local (\env -> env { envParaProperties = EnvProps (Just prop) [] <> envParaProperties env }) (getParaProps False)
862 contents <- inlinesToOpenXML opts [Image attr alt (src,tit)]
867 contents <- inlinesToOpenXML opts [Image attr alt (src,tit)]
868+ captionNode <- if null alt
869+ then return []
863− captionNode <- withParaPropM (pStyleM "Image Caption")
870+ else withParaPropM (pStyleM "Image Caption")
864− $ blockToOpenXML opts (Para alt)
871+ $ blockToOpenXML opts
872+ (Para $ Span (figid,[],[])
873+ [Str (figname <> "\160"),
874+ RawInline (Format "openxml")
875+ ("<w:fldSimple w:instr=\"SEQ Figure"
876+ <> " \\* ARABIC \"><w:r><w:t>"
877+ <> tshow fignum
878+ <> "</w:t></w:r></w:fldSimple>"),
879+ Str ":", Space] : alt)
865 return $
880 return $
866 Elem (mknode "w:p" [] (map Elem paraProps ++ contents))
881 Elem (mknode "w:p" [] (map Elem paraProps ++ contents))
867 : captionNode
882 : captionNode
@@ -1289,6 +1304,7 @@ inlineToOpenXML' opts (Image attr@(imgident, _, _) alt (src, title)) = do
1289 Just Eps -> ".eps"
1304 Just Eps -> ".eps"
1290 Just Svg -> ".svg"
1305 Just Svg -> ".svg"
1291 Just Emf -> ".emf"
1306 Just Emf -> ".emf"
1307+ Just Tiff -> ".tiff"
1292 Nothing -> ""
1308 Nothing -> ""
1293 imgpath = "media/" <> ident <> imgext
1309 imgpath = "media/" <> ident <> imgext
1294 mbMimeType = mt <|> getMimeType (T.unpack imgpath)
1310 mbMimeType = mt <|> getMimeType (T.unpack imgpath)
src/Text/Pandoc/Writers/Docx/Table.hs+30−5
@@ -17,7 +17,7 @@ import Control.Monad.State.Strict
17import Data.Array
17import Data.Array
18import Data.Text (Text)
18import Data.Text (Text)
19import Text.Pandoc.Definition
19import Text.Pandoc.Definition
20−import Text.Pandoc.Class.PandocMonad (PandocMonad)
20+import Text.Pandoc.Class.PandocMonad (PandocMonad, translateTerm)
21import Text.Pandoc.Writers.Docx.Types
21import Text.Pandoc.Writers.Docx.Types
22import Text.Pandoc.Shared
22import Text.Pandoc.Shared
23import Text.Printf (printf)
23import Text.Printf (printf)
@@ -25,6 +25,7 @@ import Text.Pandoc.Writers.GridTable hiding (Table)
25import Text.Pandoc.Writers.OOXML
25import Text.Pandoc.Writers.OOXML
26import Text.Pandoc.XML.Light as XML hiding (Attr)
26import Text.Pandoc.XML.Light as XML hiding (Attr)
27import qualified Data.Text as T
27import qualified Data.Text as T
28+import qualified Text.Pandoc.Translations as Term
28import qualified Text.Pandoc.Writers.GridTable as Grid
29import qualified Text.Pandoc.Writers.GridTable as Grid
29
30
30tableToOpenXML :: PandocMonad m
31tableToOpenXML :: PandocMonad m
@@ -33,15 +34,23 @@ tableToOpenXML :: PandocMonad m
33 -> WS m [Content]
34 -> WS m [Content]
34tableToOpenXML blocksToOpenXML gridTable = do
35tableToOpenXML blocksToOpenXML gridTable = do
35 setFirstPara
36 setFirstPara
36− let (Grid.Table _attr caption colspecs _rowheads thead tbodies tfoot) =
37+ let (Grid.Table (ident,_,_) caption colspecs _rowheads thead tbodies tfoot) =
37 gridTable
38 gridTable
38 let (Caption _maybeShortCaption captionBlocks) = caption
39 let (Caption _maybeShortCaption captionBlocks) = caption
40+ tablenum <- gets stNextTableNum
41+ unless (null captionBlocks) $
42+ modify $ \st -> st{ stNextTableNum = tablenum + 1 }
43+ let tableid = if T.null ident
44+ then "table" <> tshow tablenum
45+ else ident
46+ tablename <- translateTerm Term.Table
39 let captionStr = stringify captionBlocks
47 let captionStr = stringify captionBlocks
40 let aligns = map fst $ elems colspecs
48 let aligns = map fst $ elems colspecs
41 captionXml <- if null captionBlocks
49 captionXml <- if null captionBlocks
42 then return []
50 then return []
43 else withParaPropM (pStyleM "Table Caption")
51 else withParaPropM (pStyleM "Table Caption")
44− $ blocksToOpenXML captionBlocks
52+ $ blocksToOpenXML
53+ $ addLabel tableid tablename tablenum captionBlocks
45 -- We set "in table" after processing the caption, because we don't
54 -- We set "in table" after processing the caption, because we don't
46 -- want the "Table Caption" style to be overwritten with "Compact".
55 -- want the "Table Caption" style to be overwritten with "Compact".
47 modify $ \s -> s { stInTable = True }
56 modify $ \s -> s { stInTable = True }
@@ -81,6 +90,22 @@ tableToOpenXML blocksToOpenXML gridTable = do
81 modify $ \s -> s { stInTable = False }
90 modify $ \s -> s { stInTable = False }
82 return $ captionXml ++ [Elem tbl]
91 return $ captionXml ++ [Elem tbl]
83
92
93+addLabel :: Text -> Text -> Int -> [Block] -> [Block]
94+addLabel tableid tablename tablenum bs =
95+ case bs of
96+ (Para ils : rest) -> Para (label : Space : ils) : rest
97+ (Plain ils : rest) -> Plain (label : Space : ils) : rest
98+ _ -> Para [label] : bs
99+ where
100+ label = Span (tableid,[],[])
101+ [Str (tablename <> "\160"),
102+ RawInline (Format "openxml")
103+ ("<w:fldSimple w:instr=\"SEQ Table"
104+ <> " \\* ARABIC \"><w:r><w:t>"
105+ <> tshow tablenum
106+ <> "</w:t></w:r></w:fldSimple>"),
107+ Str ":"]
108+
84-- | Parts of a table
109-- | Parts of a table
85data RowType = HeadRow | BodyRow | FootRow
110data RowType = HeadRow | BodyRow | FootRow
86
111
@@ -116,8 +141,8 @@ cellGridToOpenXML :: PandocMonad m
116 -> [Alignment]
141 -> [Alignment]
117 -> Part
142 -> Part
118 -> WS m [Element]
143 -> WS m [Element]
119−cellGridToOpenXML blocksToOpenXML rowType aligns part@(Part _ _ rowAttrs) =
144+cellGridToOpenXML blocksToOpenXML rowType aligns part@(Part _ cellArray _) =
120− if null (indices rowAttrs)
145+ if null (elems cellArray)
121 then return mempty
146 then return mempty
122 else mapM (rowToOpenXML blocksToOpenXML) $
147 else mapM (rowToOpenXML blocksToOpenXML) $
123 partToRows rowType aligns part
148 partToRows rowType aligns part
src/Text/Pandoc/Writers/Docx/Types.hs+4
@@ -117,6 +117,8 @@ data WriterState = WriterState{
117 , stDynamicParaProps :: Set.Set ParaStyleName
117 , stDynamicParaProps :: Set.Set ParaStyleName
118 , stDynamicTextProps :: Set.Set CharStyleName
118 , stDynamicTextProps :: Set.Set CharStyleName
119 , stCurId :: Int
119 , stCurId :: Int
120+ , stNextFigureNum :: Int
121+ , stNextTableNum :: Int
120 }
122 }
121
123
122defaultWriterState :: WriterState
124defaultWriterState :: WriterState
@@ -137,6 +139,8 @@ defaultWriterState = WriterState{
137 , stDynamicParaProps = Set.empty
139 , stDynamicParaProps = Set.empty
138 , stDynamicTextProps = Set.empty
140 , stDynamicTextProps = Set.empty
139 , stCurId = 20
141 , stCurId = 20
142+ , stNextFigureNum = 1
143+ , stNextTableNum = 1
140 }
144 }
141
145
142setFirstPara :: PandocMonad m => WS m ()
146setFirstPara :: PandocMonad m => WS m ()
src/Text/Pandoc/Writers/HTML.hs+62−7
@@ -26,8 +26,13 @@ module Text.Pandoc.Writers.HTML (
26 writeSlideous,
26 writeSlideous,
27 writeDZSlides,
27 writeDZSlides,
28 writeRevealJs,
28 writeRevealJs,
29− tagWithAttributes
29+ tagWithAttributes,
30+ inlineToHtml,
31+ blockToHtml,
32+ WriterState(..),
33+ defaultWriterState
30 ) where
34 ) where
35+
31import Control.Monad.State.Strict
36import Control.Monad.State.Strict
32import Data.Char (ord)
37import Data.Char (ord)
33import Data.List (intercalate, intersperse, partition, delete, (\\), foldl')
38import Data.List (intercalate, intersperse, partition, delete, (\\), foldl')
@@ -344,6 +349,52 @@ pandocToHtml opts (Pandoc meta blocks) = do
344 PlainMath -> defField "displaymath-css" True
349 PlainMath -> defField "displaymath-css" True
345 WebTeX _ -> defField "displaymath-css" True
350 WebTeX _ -> defField "displaymath-css" True
346 _ -> id) .
351 _ -> id) .
352+ (if slideVariant == RevealJsSlides
353+ then -- set boolean options explicitly, since
354+ -- template can't distinguish False/undefined
355+ defField "controls" True .
356+ defField "controlsTutorial" True .
357+ defField "controlsLayout" ("bottom-right" :: Text) .
358+ defField "controlsBackArrows" ("faded" :: Text) .
359+ defField "progress" True .
360+ defField "slideNumber" False .
361+ defField "showSlideNumber" ("all" :: Text) .
362+ defField "hashOneBasedIndex" False .
363+ defField "hash" False .
364+ defField "respondToHashChanges" True .
365+ defField "history" False .
366+ defField "keyboard" True .
367+ defField "overview" True .
368+ defField "disableLayout" False .
369+ defField "center" True .
370+ defField "touch" True .
371+ defField "loop" False .
372+ defField "rtl" False .
373+ defField "navigationMode" ("default" :: Text) .
374+ defField "shuffle" False .
375+ defField "fragments" True .
376+ defField "fragmentInURL" True .
377+ defField "embedded" False .
378+ defField "help" True .
379+ defField "pause" True .
380+ defField "showNotes" False .
381+ defField "autoPlayMedia" ("null" :: Text) .
382+ defField "preloadIframes" ("null" :: Text) .
383+ defField "autoSlide" ("0" :: Text) .
384+ defField "autoSlideStoppable" True .
385+ defField "autoSlideMethod" ("null" :: Text) .
386+ defField "defaultTiming" ("null" :: Text) .
387+ defField "mouseWheel" False .
388+ defField "display" ("block" :: Text) .
389+ defField "hideInactiveCursor" True .
390+ defField "hideCursorTime" ("5000" :: Text) .
391+ defField "previewLinks" False .
392+ defField "transition" ("slide" :: Text) .
393+ defField "transitionSpeed" ("default" :: Text) .
394+ defField "backgroundTransition" ("fade" :: Text) .
395+ defField "viewDistance" ("3" :: Text) .
396+ defField "mobileViewDistance" ("2" :: Text)
397+ else id) .
347 defField "document-css" (isNothing mCss && slideVariant == NoSlides) .
398 defField "document-css" (isNothing mCss && slideVariant == NoSlides) .
348 defField "quotes" (stQuotes st) .
399 defField "quotes" (stQuotes st) .
349 -- for backwards compatibility we populate toc
400 -- for backwards compatibility we populate toc
@@ -613,17 +664,20 @@ dimensionsToAttrList attr = consolidateStyles $ go Width ++ go Height
613figure :: PandocMonad m
664figure :: PandocMonad m
614 => WriterOptions -> Attr -> [Inline] -> (Text, Text)
665 => WriterOptions -> Attr -> [Inline] -> (Text, Text)
615 -> StateT WriterState m Html
666 -> StateT WriterState m Html
616−figure opts attr txt (s,tit) = do
667+figure opts attr@(_, _, attrList) txt (s,tit) = do
617 html5 <- gets stHtml5
668 html5 <- gets stHtml5
618 -- Screen-readers will normally read the @alt@ text and the figure; we
669 -- Screen-readers will normally read the @alt@ text and the figure; we
619 -- want to avoid them reading the same text twice. With HTML5 we can
670 -- want to avoid them reading the same text twice. With HTML5 we can
620 -- use aria-hidden for the caption; with HTML4, we use an empty
671 -- use aria-hidden for the caption; with HTML4, we use an empty
621 -- alt-text instead.
672 -- alt-text instead.
673+ -- When the alt text differs from the caption both should be read.
622 let alt = if html5 then txt else [Str ""]
674 let alt = if html5 then txt else [Str ""]
623 let tocapt = if html5
675 let tocapt = if html5
624− then H5.figcaption !
676+ then (H5.figcaption !) $
677+ if isJust (lookup "alt" attrList)
678+ then mempty
625− H5.customAttribute (textTag "aria-hidden")
679+ else H5.customAttribute (textTag "aria-hidden")
626− (toValue @Text "true")
680+ (toValue @Text "true")
627 else H.p ! A.class_ "caption"
681 else H.p ! A.class_ "caption"
628 img <- inlineToHtml opts (Image attr alt (s,tit))
682 img <- inlineToHtml opts (Image attr alt (s,tit))
629 capt <- if null txt
683 capt <- if null txt
@@ -1387,7 +1441,7 @@ inlineToHtml opts inline = do
1387 return $ if T.null tit
1441 return $ if T.null tit
1388 then link'
1442 then link'
1389 else link' ! A.title (toValue tit)
1443 else link' ! A.title (toValue tit)
1390− (Image attr txt (s,tit)) -> do
1444+ (Image attr@(_, _, attrList) txt (s, tit)) -> do
1391 let alternate = stringify txt
1445 let alternate = stringify txt
1392 slideVariant <- gets stSlideVariant
1446 slideVariant <- gets stSlideVariant
1393 let isReveal = slideVariant == RevealJsSlides
1447 let isReveal = slideVariant == RevealJsSlides
@@ -1400,7 +1454,8 @@ inlineToHtml opts inline = do
1400 [A.title $ toValue tit | not (T.null tit)] ++
1454 [A.title $ toValue tit | not (T.null tit)] ++
1401 attrs
1455 attrs
1402 imageTag = (if html5 then H5.img else H.img
1456 imageTag = (if html5 then H5.img else H.img
1403− , [A.alt $ toValue alternate | not (null txt)] )
1457+ , [A.alt $ toValue alternate | not (null txt) &&
1458+ isNothing (lookup "alt" attrList)] )
1404 mediaTag tg fallbackTxt =
1459 mediaTag tg fallbackTxt =
1405 let linkTxt = if null txt
1460 let linkTxt = if null txt
1406 then fallbackTxt
1461 then fallbackTxt
src/Text/Pandoc/Writers/LaTeX.hs+1−1
@@ -919,7 +919,7 @@ inlineToLaTeX il@(RawInline f str) = do
919inlineToLaTeX LineBreak = do
919inlineToLaTeX LineBreak = do
920 emptyLine <- gets stEmptyLine
920 emptyLine <- gets stEmptyLine
921 setEmptyLine True
921 setEmptyLine True
922− return $ (if emptyLine then "~" else "") <> "\\\\" <> cr
922+ return $ (if emptyLine then "\\strut " else "") <> "\\\\" <> cr
923inlineToLaTeX SoftBreak = do
923inlineToLaTeX SoftBreak = do
924 wrapText <- gets (writerWrapText . stOptions)
924 wrapText <- gets (writerWrapText . stOptions)
925 case wrapText of
925 case wrapText of
src/Text/Pandoc/Writers/LaTeX/Table.hs+20−5
@@ -16,6 +16,7 @@ module Text.Pandoc.Writers.LaTeX.Table
16 ) where
16 ) where
17import Control.Monad.State.Strict
17import Control.Monad.State.Strict
18import Data.List (intersperse)
18import Data.List (intersperse)
19+import qualified Data.List.NonEmpty as NonEmpty
19import Data.List.NonEmpty (NonEmpty ((:|)))
20import Data.List.NonEmpty (NonEmpty ((:|)))
20import Data.Text (Text)
21import Data.Text (Text)
21import qualified Data.Text as T
22import qualified Data.Text as T
@@ -25,7 +26,8 @@ import Text.DocLayout
25 ( Doc, braces, cr, empty, hcat, hsep, isEmpty, literal, nest
26 ( Doc, braces, cr, empty, hcat, hsep, isEmpty, literal, nest
26 , text, vcat, ($$) )
27 , text, vcat, ($$) )
27import Text.Pandoc.Shared (blocksToInlines, splitBy, tshow)
28import Text.Pandoc.Shared (blocksToInlines, splitBy, tshow)
28−import Text.Pandoc.Walk (walk)
29+import Text.Pandoc.Walk (walk, query)
30+import Data.Monoid (Any(..))
29import Text.Pandoc.Writers.LaTeX.Caption (getCaption)
31import Text.Pandoc.Writers.LaTeX.Caption (getCaption)
30import Text.Pandoc.Writers.LaTeX.Notes (notesToLaTeX)
32import Text.Pandoc.Writers.LaTeX.Notes (notesToLaTeX)
31import Text.Pandoc.Writers.LaTeX.Types
33import Text.Pandoc.Writers.LaTeX.Types
@@ -243,8 +245,13 @@ cellToLaTeX :: PandocMonad m
243 -> Ann.Cell
245 -> Ann.Cell
244 -> LW m (Doc Text)
246 -> LW m (Doc Text)
245cellToLaTeX blockListToLaTeX celltype annotatedCell = do
247cellToLaTeX blockListToLaTeX celltype annotatedCell = do
246− let (Ann.Cell _specs _colnum cell) = annotatedCell
248+ let (Ann.Cell specs _colnum cell) = annotatedCell
249+ let hasWidths = snd (NonEmpty.head specs) /= ColWidthDefault
250+ let specAlign = fst (NonEmpty.head specs)
247− let (Cell _attr align rowspan colspan blocks) = cell
251+ let (Cell _attr align' rowspan colspan blocks) = cell
252+ let align = case align' of
253+ AlignDefault -> specAlign
254+ _ -> align'
248 beamer <- gets stBeamer
255 beamer <- gets stBeamer
249 externalNotes <- gets stExternalNotes
256 externalNotes <- gets stExternalNotes
250 inMinipage <- gets stInMinipage
257 inMinipage <- gets stInMinipage
@@ -255,8 +262,13 @@ cellToLaTeX blockListToLaTeX celltype annotatedCell = do
255 Para{} -> True
262 Para{} -> True
256 Plain{} -> True
263 Plain{} -> True
257 _ -> False
264 _ -> False
265+ let hasLineBreak LineBreak = Any True
266+ hasLineBreak _ = Any False
267+ let hasLineBreaks = getAny $ query hasLineBreak blocks
258 result <-
268 result <-
269+ if not hasWidths || (celltype /= HeaderCell
259− if all isPlainOrPara blocks
270+ && all isPlainOrPara blocks
271+ && not hasLineBreaks)
260 then
272 then
261 blockListToLaTeX $ walk fixLineBreaks $ walk displayMathToInline blocks
273 blockListToLaTeX $ walk fixLineBreaks $ walk displayMathToInline blocks
262 else do
274 else do
@@ -269,7 +281,9 @@ cellToLaTeX blockListToLaTeX celltype annotatedCell = do
269 let halign = literal $ alignCommand align
281 let halign = literal $ alignCommand align
270 return $ "\\begin{minipage}" <> valign <>
282 return $ "\\begin{minipage}" <> valign <>
271 braces "\\linewidth" <> halign <> cr <>
283 braces "\\linewidth" <> halign <> cr <>
272− cellContents <> cr <>
284+ cellContents <>
285+ (if hasLineBreaks then "\\strut" else mempty)
286+ <> cr <>
273 "\\end{minipage}"
287 "\\end{minipage}"
274 modify $ \st -> st{ stExternalNotes = externalNotes }
288 modify $ \st -> st{ stExternalNotes = externalNotes }
275 when (rowspan /= RowSpan 1) $
289 when (rowspan /= RowSpan 1) $
@@ -290,3 +304,4 @@ cellToLaTeX blockListToLaTeX celltype annotatedCell = do
290data CellType
304data CellType
291 = HeaderCell
305 = HeaderCell
292 | BodyCell
306 | BodyCell
307+ deriving Eq
src/Text/Pandoc/Writers/Markdown.hs+6−4
@@ -75,7 +75,6 @@ writeCommonMark opts document =
75 -- we set them here so that escapeText will behave
75 -- we set them here so that escapeText will behave
76 -- properly.
76 -- properly.
77 enableExtension Ext_all_symbols_escapable $
77 enableExtension Ext_all_symbols_escapable $
78− enableExtension Ext_pipe_tables $
79 enableExtension Ext_intraword_underscores $
78 enableExtension Ext_intraword_underscores $
80 writerExtensions opts }
79 writerExtensions opts }
81
80
@@ -257,10 +256,10 @@ noteToMarkdown opts num blocks = do
257 then hang (writerTabStop opts) (marker <> spacer) contents
256 then hang (writerTabStop opts) (marker <> spacer) contents
258 else marker <> spacer <> contents
257 else marker <> spacer <> contents
259
258
260−-- | (Code) blocks with a single class can just use it standalone,
259+-- | (Code) blocks with a single class and no attributes can just use it
261−-- no need to bother with curly braces.
260+-- standalone, no need to bother with curly braces.
262classOrAttrsToMarkdown :: Attr -> Doc Text
261classOrAttrsToMarkdown :: Attr -> Doc Text
263−classOrAttrsToMarkdown ("",[cls],_) = literal cls
262+classOrAttrsToMarkdown ("",[cls],[]) = literal cls
264classOrAttrsToMarkdown attrs = attrsToMarkdown attrs
263classOrAttrsToMarkdown attrs = attrsToMarkdown attrs
265
264
266-- | Ordered list start parser for use in Para below.
265-- | Ordered list start parser for use in Para below.
@@ -792,6 +791,9 @@ blockListToMarkdown opts blocks = do
792 b1 : commentSep : fixBlocks (b2:bs)
791 b1 : commentSep : fixBlocks (b2:bs)
793 fixBlocks (Plain ils : bs@(RawBlock{}:_)) =
792 fixBlocks (Plain ils : bs@(RawBlock{}:_)) =
794 Plain ils : fixBlocks bs
793 Plain ils : fixBlocks bs
794+ fixBlocks (Plain ils : bs@(Div{}:_))
795+ | isEnabled Ext_fenced_divs opts =
796+ Para ils : fixBlocks bs
795 fixBlocks (Plain ils : bs) | inlist =
797 fixBlocks (Plain ils : bs) | inlist =
796 Plain ils : fixBlocks bs
798 Plain ils : fixBlocks bs
797 fixBlocks (Plain ils : bs) =
799 fixBlocks (Plain ils : bs) =
src/Text/Pandoc/Writers/Powerpoint/Output.hs+1
@@ -537,6 +537,7 @@ registerMedia fp caption = do
537 Just Eps -> Just ".eps"
537 Just Eps -> Just ".eps"
538 Just Svg -> Just ".svg"
538 Just Svg -> Just ".svg"
539 Just Emf -> Just ".emf"
539 Just Emf -> Just ".emf"
540+ Just Tiff -> Just ".tiff"
540 Nothing -> Nothing
541 Nothing -> Nothing
541
542
542 let newGlobalId = fromMaybe (maxGlobalId + 1) (M.lookup fp globalIds)
543 let newGlobalId = fromMaybe (maxGlobalId + 1) (M.lookup fp globalIds)
stack.yaml+9−11
@@ -7,18 +7,16 @@ flags:
7packages:
7packages:
8- '.'
8- '.'
9extra-deps:
9extra-deps:
10−- haddock-library-1.10.0
10+- commonmark-0.2.1
11−- hslua-1.3.0
11+- commonmark-pandoc-0.2.1.1
12−- hslua-module-path-0.1.0
12+- skylighting-core-0.10.5.2
13−- jira-wiki-markup-1.4.0
13+- skylighting-0.10.5.2
14−- random-1.2.0
14+- git: https://github.com/jgm/doctemplates
15−- unicode-collation-0.1.3
15+ commit: 428c26d5303cf7a2b1051fe1ffd9aafe9ba71c81
16−- citeproc-0.4.0.1
16+- git: https://github.com/jgm/citeproc
17−- commonmark-0.2
17+ commit: 4ce0501cd6f9c86eee087afcf878c256e49b9615
18−- commonmark-extensions-0.2.1.2
19−- commonmark-pandoc-0.2.1
20ghc-options:
18ghc-options:
21 "$locals": -fhide-source-paths -Wno-missing-home-modules
19 "$locals": -fhide-source-paths -Wno-missing-home-modules
22−resolver: lts-17.12
20+resolver: lts-18.0
23nix:
21nix:
24 packages: [zlib]
22 packages: [zlib]
test/Tests/Writers/OOXML.hs+3−1
@@ -55,7 +55,9 @@ testArchive :: (WriterOptions -> Pandoc -> PandocIO BL.ByteString)
55 -> IO Archive
55 -> IO Archive
56testArchive writerFn opts fp = do
56testArchive writerFn opts fp = do
57 txt <- T.readFile fp
57 txt <- T.readFile fp
58+ bs <- runIOorExplode $ do
59+ setTranslations "en-US"
58− bs <- runIOorExplode $ readNative def txt >>= writerFn opts
60+ readNative def txt >>= writerFn opts
59 return $ toArchive bs
61 return $ toArchive bs
60
62
61compareFileList :: FilePath -> Archive -> Archive -> Maybe String
63compareFileList :: FilePath -> Archive -> Archive -> Maybe String
test/command/2874.md+2−2
@@ -3,12 +3,12 @@
3<a></a>
3<a></a>
4<br/>
4<br/>
5^D
5^D
6−{}~\\
6+{}\strut \\
7```
7```
8
8
9```
9```
10% pandoc -f html -t latex
10% pandoc -f html -t latex
11<a name="foo"></a><br/>
11<a name="foo"></a><br/>
12^D
12^D
13−\protect\hypertarget{foo}{}{}~\\
13+\protect\hypertarget{foo}{}{}\strut \\
14```
14```
test/command/4465.mdnew file+15
@@ -0,0 +1,15 @@
1+```
2+% pandoc -f html -t markdown
3+<ol>
4+ <li>An ordered list can contain block-level elements ind html, it means that divs are also allowed.</li>
5+ <li>Let's see the problem! <div class="example">This is an example.</div></li>
6+</ol>
7+^D
8+1. An ordered list can contain block-level elements ind html, it means
9+ that divs are also allowed.
10+2. Let\'s see the problem!
11+
12+ ::: example
13+ This is an example.
14+ :::
15+```
test/command/5367.md+6−2
@@ -24,11 +24,15 @@ hello\footnote{doc footnote}
24 >{\centering\arraybackslash}p{(\columnwidth - 0\tabcolsep) * \real{0.17}}@{}}
24 >{\centering\arraybackslash}p{(\columnwidth - 0\tabcolsep) * \real{0.17}}@{}}
25\caption[Sample table.]{Sample table.\footnote{caption footnote}}\tabularnewline
25\caption[Sample table.]{Sample table.\footnote{caption footnote}}\tabularnewline
26\toprule
26\toprule
27+\begin{minipage}[b]{\linewidth}\centering
27−Fruit\footnote{header footnote} \\
28+Fruit\footnote{header footnote}
29+\end{minipage} \\
28\midrule
30\midrule
29\endfirsthead
31\endfirsthead
30\toprule
32\toprule
33+\begin{minipage}[b]{\linewidth}\centering
31−Fruit{} \\
34+Fruit{}
35+\end{minipage} \\
32\midrule
36\midrule
33\endhead
37\endhead
34Bans\footnote{table cell footnote} \\
38Bans\footnote{table cell footnote} \\
test/command/6890.md+2−2
@@ -23,12 +23,12 @@ references:
23
23
24@fruchtel-sozialer-2013a
24@fruchtel-sozialer-2013a
25
25
26−Some text [^1].
26+Some text.[^1]
27
27
28[^1]: @fruchtel-sozialer-2013a
28[^1]: @fruchtel-sozialer-2013a
29^D
29^D
30[Para [Cite [Citation {citationId = "fruchtel-sozialer-2013a", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 1, citationHash = 0}] [Str "Fr\252chtel,",Space,Str "Budde,",Space,Str "and",Space,Str "Cyprian",Space,Str "(2013)"]]
30[Para [Cite [Citation {citationId = "fruchtel-sozialer-2013a", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 1, citationHash = 0}] [Str "Fr\252chtel,",Space,Str "Budde,",Space,Str "and",Space,Str "Cyprian",Space,Str "(2013)"]]
31−,Para [Str "Some",Space,Str "text",Str ".",Note [Para [Cite [Citation {citationId = "fruchtel-sozialer-2013a", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 2, citationHash = 0}] [Str "Fr\252chtel,",Space,Str "Budde,",Space,Str "and",Space,Str "Cyprian",Space,Str "(2013)"]]],Str ""]
31+,Para [Str "Some",Space,Str "text.",Note [Para [Cite [Citation {citationId = "fruchtel-sozialer-2013a", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 2, citationHash = 0}] [Str "Fr\252chtel,",Space,Str "Budde,",Space,Str "and",Space,Str "Cyprian",Space,Str "(2013)"]]]]
32,Div ("refs",["references","csl-bib-body","hanging-indent"],[])
32,Div ("refs",["references","csl-bib-body","hanging-indent"],[])
33 [Div ("ref-fruchtel-sozialer-2013a",["csl-entry"],[])
33 [Div ("ref-fruchtel-sozialer-2013a",["csl-entry"],[])
34 [Para [Str "Fr\252chtel,",Space,Str "Frank,",Space,Str "Wolfgang",Space,Str "Budde,",Space,Str "and",Space,Str "Gudrun",Space,Str "Cyprian.",Space,Str "2013.",Space,Emph [Str "Sozialer",Space,Str "Raum",Space,Str "und",Space,Str "Soziale",Space,Str "Arbeit",Space,Str "Fieldbook:",Space,Str "Methoden",Space,Str "und",Space,Str "Techniken"],Str ".",Space,Str "3rd",Space,Str "ed.",Space,Str "Wiesbaden,",Space,Str "Germany:",Space,Str "Springer",Space,Str "VS."]]]]
34 [Para [Str "Fr\252chtel,",Space,Str "Frank,",Space,Str "Wolfgang",Space,Str "Budde,",Space,Str "and",Space,Str "Gudrun",Space,Str "Cyprian.",Space,Str "2013.",Space,Emph [Str "Sozialer",Space,Str "Raum",Space,Str "und",Space,Str "Soziale",Space,Str "Arbeit",Space,Str "Fieldbook:",Space,Str "Methoden",Space,Str "und",Space,Str "Techniken"],Str ".",Space,Str "3rd",Space,Str "ed.",Space,Str "Wiesbaden,",Space,Str "Germany:",Space,Str "Springer",Space,Str "VS."]]]]
test/command/7272.md+4−1
@@ -18,7 +18,10 @@
18 >{\raggedright\arraybackslash}p{(\columnwidth - 0\tabcolsep) * \real{1.00}}@{}}
18 >{\raggedright\arraybackslash}p{(\columnwidth - 0\tabcolsep) * \real{1.00}}@{}}
19\toprule
19\toprule
20\endhead
20\endhead
21−{\vtop{\hbox{\strut text}\hbox{\strut text2 }}} \\
21+\begin{minipage}[t]{\linewidth}\raggedright
22+{ text\\
23+text2 }\strut
24+\end{minipage} \\
22\bottomrule
25\bottomrule
23\end{longtable}
26\end{longtable}
24```
27```
test/command/7376.mdnew file+16
@@ -0,0 +1,16 @@
1+```
2+% pandoc --citeproc -t plain
3+---
4+references:
5+- id: item1
6+ type: book
7+ author:
8+ - family: Doe
9+ given: Jane
10+ issued: 2020
11+ title: The title
12+...
13+^D
14+
15+
16+```
test/command/7394.mdnew file+85
@@ -0,0 +1,85 @@
1+```
2+% pandoc -f markdown -t plain --citeproc
3+---
4+csl: command/chicago-fullnote-bibliography.csl
5+references:
6+- author:
7+ - family: Wandt
8+ given: Manfred
9+ edition: 6
10+ id: wandt2014ges-sv
11+ issued: 2014
12+ publisher: Franz Vahlen
13+ publisher-place: München
14+ title: Gesetzliche schuldverhältnisse
15+ title-short: Gesetzl SV
16+ type: book
17+- author:
18+ - family: Smith
19+ given: Zenda
20+ edition: 6
21+ id: smith2015
22+ issued: 2015
23+ publisher: Macmillan
24+ publisher-place: New York
25+ title: A verb and a noun
26+ type: book
27+---
28+
29+Hi^[@wandt2014ges-sv.].
30+
31+Hi^[[@wandt2014ges-sv].].
32+
33+Hi^[[See also @wandt2014ges-sv].].
34+
35+Hi^[See also @wandt2014ges-sv.].
36+
37+Hi^[@wandt2014ges-sv [@smith2015].].
38+
39+Hi^[[@wandt2014ges-sv; @smith2015].].
40+
41+Hi [@wandt2014ges-sv].
42+
43+Hi [see also @wandt2014ges-sv].
44+
45+^D
46+Hi[1].
47+
48+Hi[2].
49+
50+Hi[3].
51+
52+Hi[4].
53+
54+Hi[5].
55+
56+Hi[6].
57+
58+Hi.[7]
59+
60+Hi.[8]
61+
62+Smith, Zenda. A Verb and a Noun. 6th ed. New York: Macmillan, 2015.
63+
64+Wandt, Manfred. Gesetzliche Schuldverhältnisse. 6th ed. München: Franz
65+Vahlen, 2014.
66+
67+[1] Manfred Wandt, Gesetzliche Schuldverhältnisse, 6th ed. (München:
68+Franz Vahlen, 2014).
69+
70+[2] Wandt.
71+
72+[3] See also Wandt.
73+
74+[4] See also Wandt.
75+
76+[5] Wandt, Zenda Smith, A Verb and a Noun, 6th ed. (New York: Macmillan,
77+2015).
78+
79+[6] Wandt, Gesetzl SV; Smith, A Verb and a Noun.
80+
81+[7] Wandt, Gesetzl SV.
82+
83+[8] See also Wandt.
84+```
85+
test/command/7397.mdnew file+14
@@ -0,0 +1,14 @@
1+````
2+% pandoc -t markdown
3+~~~~ { .haskell startFrom="100"}
4+qsort [] = []
5+qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
6+ qsort (filter (>= x) xs)
7+~~~~
8+^D
9+``` {.haskell startFrom="100"}
10+qsort [] = []
11+qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
12+ qsort (filter (>= x) xs)
13+```
14+````
test/command/7400.mdnew file+9
@@ -0,0 +1,9 @@
1+```
2+% pandoc -t native -s
3+---
4+# Comment only
5+...
6+^D
7+Pandoc (Meta {unMeta = fromList []})
8+[]
9+```
test/command/7416.mdnew file+19
@@ -0,0 +1,19 @@
1+```
2+% pandoc -f markdown -t html
3+![caption](../media/rId25.jpg "title"){alt="alt"}
4+
5+^D
6+<figure>
7+<img src="../media/rId25.jpg" title="title" alt="alt" /><figcaption>caption</figcaption>
8+</figure>
9+```
10+
11+```
12+% pandoc -f markdown -t html
13+![caption](../media/rId25.jpg "title")
14+
15+^D
16+<figure>
17+<img src="../media/rId25.jpg" title="title" alt="caption" /><figcaption aria-hidden="true">caption</figcaption>
18+</figure>
19+```
test/command/pandoc-citeproc-322.md+1−1
@@ -19,7 +19,7 @@ references:
19 type: 'article-journal'
19 type: 'article-journal'
20---
20---
21
21
22−Foo[@timmory__justice_1950].
22+Foo [@timmory__justice_1950].
23^D
23^D
24Foo.[^1]
24Foo.[^1]
25
25
test/command/pandoc-citeproc-356.md+2−7
@@ -15,11 +15,6 @@ references:
15
15
16[@bar]
16[@bar]
17^D
17^D
18−(Alice 2042)
18+[WARNING] Citeproc: citation bar not found
19−
19+(**bar?**)
20−::: {#refs .references .csl-bib-body .hanging-indent}
21−::: {#ref-foo .csl-entry}
22−Alice. 2042.
23−:::
24−:::
25```
20```
test/command/pandoc-citeproc-chicago-author-date.md+7−7
@@ -54,14 +54,14 @@ References {#references .unnumbered}
54
54
55([**nonexistent?**](#ref-nonexistent))
55([**nonexistent?**](#ref-nonexistent))
56
56
57−[Doe](#ref-item1) ([2005](#ref-item1)) says blah.
57+Doe ([2005](#ref-item1)) says blah.
58
58
59−[Doe](#ref-item1) ([2005, 30](#ref-item1)) says blah.
59+Doe ([2005, 30](#ref-item1)) says blah.
60
60
61−[Doe](#ref-item1) ([2005, 30](#ref-item1), with suffix) says blah.
61+Doe ([2005, 30](#ref-item1), with suffix) says blah.
62
62
63−[Doe](#ref-item1) ([2005](#ref-item1); [2006, 30](#ref-item2); see also
63+Doe ([2005](#ref-item1); [2006, 30](#ref-item2); see also [Doe and Roe
64−[Doe and Roe 2007](#ref-пункт3)) says blah.
64+2007](#ref-пункт3)) says blah.
65
65
66In a note.[^1]
66In a note.[^1]
67
67
@@ -98,8 +98,8 @@ edited by Sam Smith. Oxford: Oxford University Press.
98:::
98:::
99:::
99:::
100
100
101−[^1]: [Doe and Roe](#ref-пункт3) ([2007, 12](#ref-пункт3)) and a
101+[^1]: Doe and Roe ([2007, 12](#ref-пункт3)) and a citation without
102− citation without locators ([Doe and Roe 2007](#ref-пункт3)).
102+ locators ([Doe and Roe 2007](#ref-пункт3)).
103
103
104[^2]: Some citations (see [Doe 2005, chap. 3](#ref-item1);
104[^2]: Some citations (see [Doe 2005, chap. 3](#ref-item1);
105 [2006](#ref-item2); [Doe and Roe 2007](#ref-пункт3)).
105 [2006](#ref-item2); [Doe and Roe 2007](#ref-пункт3)).
test/command/pandoc-citeproc-chicago-fullnote-bibliography.md+6−7
@@ -55,13 +55,13 @@ References {#references .unnumbered}
55
55
56[^2]
56[^2]
57
57
58−[John Doe](#ref-item1)[^3] says blah.
58+John Doe[^3] says blah.
59
59
60−[Doe](#ref-item1)[^4] says blah.
60+Doe[^4] says blah.
61
61
62−[Doe](#ref-item1)[^5] says blah.
62+Doe[^5] says blah.
63
63
64−[Doe](#ref-item1)[^6] says blah.
64+Doe[^6] says blah.
65
65
66In a note.[^7]
66In a note.[^7]
67
67
@@ -112,9 +112,8 @@ Sam Smith. Oxford: Oxford University Press, 2007.
112 Roe, "Why Water Is Wet," in *Third Book*, ed. Sam Smith (Oxford:
112 Roe, "Why Water Is Wet," in *Third Book*, ed. Sam Smith (Oxford:
113 Oxford University Press, 2007)](#ref-пункт3).
113 Oxford University Press, 2007)](#ref-пункт3).
114
114
115−[^7]: [Doe and Roe](#ref-пункт3), ["Why Water Is Wet," 12](#ref-пункт3)
115+[^7]: Doe and Roe, ["Why Water Is Wet," 12](#ref-пункт3) and a citation
116− and a citation without locators ([Doe and Roe, "Why Water Is
116+ without locators ([Doe and Roe, "Why Water Is Wet"](#ref-пункт3)).
117− Wet"](#ref-пункт3)).
118
117
119[^8]: See [Doe, *First Book*, chap. 3](#ref-item1); also [Doe and Roe,
118[^8]: See [Doe, *First Book*, chap. 3](#ref-item1); also [Doe and Roe,
120 "Why Water Is Wet," 34--35](#ref-пункт3).
119 "Why Water Is Wet," 34--35](#ref-пункт3).
test/docx/golden/image.docx

Binary file not shown.

test/lhs-test.html+2−1
@@ -21,7 +21,7 @@
21 padding-top: 50px;
21 padding-top: 50px;
22 padding-bottom: 50px;
22 padding-bottom: 50px;
23 hyphens: auto;
23 hyphens: auto;
24− word-wrap: break-word;
24+ overflow-wrap: break-word;
25 text-rendering: optimizeLegibility;
25 text-rendering: optimizeLegibility;
26 font-kerning: normal;
26 font-kerning: normal;
27 }
27 }
@@ -92,6 +92,7 @@
92 pre code {
92 pre code {
93 padding: 0;
93 padding: 0;
94 overflow: visible;
94 overflow: visible;
95+ overflow-wrap: normal;
95 }
96 }
96 .sourceCode {
97 .sourceCode {
97 background-color: transparent;
98 background-color: transparent;
test/lhs-test.html+lhs+2−1
@@ -21,7 +21,7 @@
21 padding-top: 50px;
21 padding-top: 50px;
22 padding-bottom: 50px;
22 padding-bottom: 50px;
23 hyphens: auto;
23 hyphens: auto;
24− word-wrap: break-word;
24+ overflow-wrap: break-word;
25 text-rendering: optimizeLegibility;
25 text-rendering: optimizeLegibility;
26 font-kerning: normal;
26 font-kerning: normal;
27 }
27 }
@@ -92,6 +92,7 @@
92 pre code {
92 pre code {
93 padding: 0;
93 padding: 0;
94 overflow: visible;
94 overflow: visible;
95+ overflow-wrap: normal;
95 }
96 }
96 .sourceCode {
97 .sourceCode {
97 background-color: transparent;
98 background-color: transparent;
test/lhs-test.latex+3−3
@@ -4,9 +4,6 @@
4%
4%
5\documentclass[
5\documentclass[
6]{article}
6]{article}
7−\author{}
8−\date{}
9−
10\usepackage{amsmath,amssymb}
7\usepackage{amsmath,amssymb}
11\usepackage{lmodern}
8\usepackage{lmodern}
12\usepackage{iftex}
9\usepackage{iftex}
@@ -88,6 +85,9 @@
88 \usepackage{selnolig} % disable illegal ligatures
85 \usepackage{selnolig} % disable illegal ligatures
89\fi
86\fi
90
87
88+\author{}
89+\date{}
90+
91\begin{document}
91\begin{document}
92
92
93\hypertarget{lhs-test}{%
93\hypertarget{lhs-test}{%
test/lhs-test.latex+lhs+3−3
@@ -4,9 +4,6 @@
4%
4%
5\documentclass[
5\documentclass[
6]{article}
6]{article}
7−\author{}
8−\date{}
9−
10\usepackage{amsmath,amssymb}
7\usepackage{amsmath,amssymb}
11\usepackage{lmodern}
8\usepackage{lmodern}
12\usepackage{iftex}
9\usepackage{iftex}
@@ -55,6 +52,9 @@
55 \usepackage{selnolig} % disable illegal ligatures
52 \usepackage{selnolig} % disable illegal ligatures
56\fi
53\fi
57
54
55+\author{}
56+\date{}
57+
58\begin{document}
58\begin{document}
59
59
60\hypertarget{lhs-test}{%
60\hypertarget{lhs-test}{%
test/tables.latex+27−3
@@ -56,11 +56,27 @@ Multiline table with caption:
56 >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.35}}@{}}
56 >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.35}}@{}}
57\caption{Here's the caption. It may span multiple lines.}\tabularnewline
57\caption{Here's the caption. It may span multiple lines.}\tabularnewline
58\toprule
58\toprule
59+\begin{minipage}[b]{\linewidth}\centering
59−Centered Header & Left Aligned & Right Aligned & Default aligned \\
60+Centered Header
61+\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
62+Left Aligned
63+\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedleft
64+Right Aligned
65+\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
66+Default aligned
67+\end{minipage} \\
60\midrule
68\midrule
61\endfirsthead
69\endfirsthead
62\toprule
70\toprule
71+\begin{minipage}[b]{\linewidth}\centering
63−Centered Header & Left Aligned & Right Aligned & Default aligned \\
72+Centered Header
73+\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
74+Left Aligned
75+\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedleft
76+Right Aligned
77+\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
78+Default aligned
79+\end{minipage} \\
64\midrule
80\midrule
65\endhead
81\endhead
66First & row & 12.0 & Example of a row that spans multiple lines. \\
82First & row & 12.0 & Example of a row that spans multiple lines. \\
@@ -76,7 +92,15 @@ Multiline table without caption:
76 >{\raggedleft\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.16}}
92 >{\raggedleft\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.16}}
77 >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.35}}@{}}
93 >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.35}}@{}}
78\toprule
94\toprule
95+\begin{minipage}[b]{\linewidth}\centering
79−Centered Header & Left Aligned & Right Aligned & Default aligned \\
96+Centered Header
97+\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
98+Left Aligned
99+\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedleft
100+Right Aligned
101+\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
102+Default aligned
103+\end{minipage} \\
80\midrule
104\midrule
81\endhead
105\endhead
82First & row & 12.0 & Example of a row that spans multiple lines. \\
106First & row & 12.0 & Example of a row that spans multiple lines. \\
test/tables/nordics.latex+22−4
@@ -5,13 +5,31 @@
5 >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.20}}@{}}
5 >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.20}}@{}}
6\caption{States belonging to the \emph{Nordics.}}\tabularnewline
6\caption{States belonging to the \emph{Nordics.}}\tabularnewline
7\toprule
7\toprule
8−Name & Capital & \vtop{\hbox{\strut Population}\hbox{\strut (in 2018)}} &
8+\begin{minipage}[b]{\linewidth}\centering
9+Name
10+\end{minipage} & \begin{minipage}[b]{\linewidth}\centering
11+Capital
12+\end{minipage} & \begin{minipage}[b]{\linewidth}\centering
13+Population\\
14+(in 2018)\strut
15+\end{minipage} & \begin{minipage}[b]{\linewidth}\centering
16+Area\\
9−\vtop{\hbox{\strut Area}\hbox{\strut (in km\textsuperscript{2})}} \\
17+(in km\textsuperscript{2})\strut
18+\end{minipage} \\
10\midrule
19\midrule
11\endfirsthead
20\endfirsthead
12\toprule
21\toprule
13−Name & Capital & \vtop{\hbox{\strut Population}\hbox{\strut (in 2018)}} &
22+\begin{minipage}[b]{\linewidth}\centering
23+Name
24+\end{minipage} & \begin{minipage}[b]{\linewidth}\centering
25+Capital
26+\end{minipage} & \begin{minipage}[b]{\linewidth}\centering
27+Population\\
28+(in 2018)\strut
29+\end{minipage} & \begin{minipage}[b]{\linewidth}\centering
30+Area\\
14−\vtop{\hbox{\strut Area}\hbox{\strut (in km\textsuperscript{2})}} \\
31+(in km\textsuperscript{2})\strut
32+\end{minipage} \\
15\midrule
33\midrule
16\endhead
34\endhead
17Denmark & Copenhagen & 5,809,502 & 43,094 \\
35Denmark & Copenhagen & 5,809,502 & 43,094 \\
test/tables/planets.latex+4−4
@@ -1,18 +1,18 @@
1\begin{longtable}[]{@{}cclrrrrrrrrl@{}}
1\begin{longtable}[]{@{}cclrrrrrrrrl@{}}
2\caption{Data about the planets of our solar system.}\tabularnewline
2\caption{Data about the planets of our solar system.}\tabularnewline
3\toprule
3\toprule
4−\multicolumn{2}{l}{} & Name & Mass (10\^{}24kg) & Diameter (km) & Density
4+\multicolumn{2}{c}{} & Name & Mass (10\^{}24kg) & Diameter (km) & Density
5(kg/m\^{}3) & Gravity (m/s\^{}2) & Length of day (hours) & Distance from Sun
5(kg/m\^{}3) & Gravity (m/s\^{}2) & Length of day (hours) & Distance from Sun
6(10\^{}6km) & Mean temperature (C) & Number of moons & Notes \\
6(10\^{}6km) & Mean temperature (C) & Number of moons & Notes \\
7\midrule
7\midrule
8\endfirsthead
8\endfirsthead
9\toprule
9\toprule
10−\multicolumn{2}{l}{} & Name & Mass (10\^{}24kg) & Diameter (km) & Density
10+\multicolumn{2}{c}{} & Name & Mass (10\^{}24kg) & Diameter (km) & Density
11(kg/m\^{}3) & Gravity (m/s\^{}2) & Length of day (hours) & Distance from Sun
11(kg/m\^{}3) & Gravity (m/s\^{}2) & Length of day (hours) & Distance from Sun
12(10\^{}6km) & Mean temperature (C) & Number of moons & Notes \\
12(10\^{}6km) & Mean temperature (C) & Number of moons & Notes \\
13\midrule
13\midrule
14\endhead
14\endhead
15−\multicolumn{2}{l}{\multirow{4}{*}{Terrestrial planets}} & Mercury & 0.330 &
15+\multicolumn{2}{c}{\multirow{4}{*}{Terrestrial planets}} & Mercury & 0.330 &
164,879 & 5427 & 3.7 & 4222.6 & 57.9 & 167 & 0 & Closest to the Sun \\
164,879 & 5427 & 3.7 & 4222.6 & 57.9 & 167 & 0 & Closest to the Sun \\
17& & Venus & 4.87 & 12,104 & 5243 & 8.9 & 2802.0 & 108.2 & 464 & 0 & \\
17& & Venus & 4.87 & 12,104 & 5243 & 8.9 & 2802.0 & 108.2 & 464 & 0 & \\
18& & Earth & 5.97 & 12,756 & 5514 & 9.8 & 24.0 & 149.6 & 15 & 1 & Our world \\
18& & Earth & 5.97 & 12,756 & 5514 & 9.8 & 24.0 & 149.6 & 15 & 1 & Our world \\
@@ -24,7 +24,7 @@ planet \\
24& \multirow{2}{*}{Ice giants} & Uranus & 86.8 & 51,118 & 1271 & 8.7 & 17.2 &
24& \multirow{2}{*}{Ice giants} & Uranus & 86.8 & 51,118 & 1271 & 8.7 & 17.2 &
252872.5 & -195 & 27 & \\
252872.5 & -195 & 27 & \\
26& & Neptune & 102 & 49,528 & 1638 & 11.0 & 16.1 & 4495.1 & -200 & 14 & \\
26& & Neptune & 102 & 49,528 & 1638 & 11.0 & 16.1 & 4495.1 & -200 & 14 & \\
27−\multicolumn{2}{l}{Dwarf planets} & Pluto & 0.0146 & 2,370 & 2095 & 0.7 &
27+\multicolumn{2}{c}{Dwarf planets} & Pluto & 0.0146 & 2,370 & 2095 & 0.7 &
28153.3 & 5906.4 & -225 & 5 & Declassified as a planet in 2006. \\
28153.3 & 5906.4 & -225 & 5 & Declassified as a planet in 2006. \\
29\bottomrule
29\bottomrule
30\end{longtable}
30\end{longtable}
test/tables/students.latex+10−2
@@ -3,11 +3,19 @@
3 >{\raggedright\arraybackslash}p{(\columnwidth - 2\tabcolsep) * \real{0.50}}@{}}
3 >{\raggedright\arraybackslash}p{(\columnwidth - 2\tabcolsep) * \real{0.50}}@{}}
4\caption{List of Students}\tabularnewline
4\caption{List of Students}\tabularnewline
5\toprule
5\toprule
6+\begin{minipage}[b]{\linewidth}\centering
6−Student ID & Name \\
7+Student ID
8+\end{minipage} & \begin{minipage}[b]{\linewidth}\centering
9+Name
10+\end{minipage} \\
7\midrule
11\midrule
8\endfirsthead
12\endfirsthead
9\toprule
13\toprule
14+\begin{minipage}[b]{\linewidth}\centering
10−Student ID & Name \\
15+Student ID
16+\end{minipage} & \begin{minipage}[b]{\linewidth}\centering
17+Name
18+\end{minipage} \\
11\midrule
19\midrule
12\endhead
20\endhead
13\multicolumn{2}{l}{Computer Science} \\
21\multicolumn{2}{l}{Computer Science} \\
test/writer.html4+2−1
@@ -24,7 +24,7 @@
24 padding-top: 50px;
24 padding-top: 50px;
25 padding-bottom: 50px;
25 padding-bottom: 50px;
26 hyphens: auto;
26 hyphens: auto;
27− word-wrap: break-word;
27+ overflow-wrap: break-word;
28 text-rendering: optimizeLegibility;
28 text-rendering: optimizeLegibility;
29 font-kerning: normal;
29 font-kerning: normal;
30 }
30 }
@@ -95,6 +95,7 @@
95 pre code {
95 pre code {
96 padding: 0;
96 padding: 0;
97 overflow: visible;
97 overflow: visible;
98+ overflow-wrap: normal;
98 }
99 }
99 .sourceCode {
100 .sourceCode {
100 background-color: transparent;
101 background-color: transparent;
test/writer.html5+2−1
@@ -24,7 +24,7 @@
24 padding-top: 50px;
24 padding-top: 50px;
25 padding-bottom: 50px;
25 padding-bottom: 50px;
26 hyphens: auto;
26 hyphens: auto;
27− word-wrap: break-word;
27+ overflow-wrap: break-word;
28 text-rendering: optimizeLegibility;
28 text-rendering: optimizeLegibility;
29 font-kerning: normal;
29 font-kerning: normal;
30 }
30 }
@@ -95,6 +95,7 @@
95 pre code {
95 pre code {
96 padding: 0;
96 padding: 0;
97 overflow: visible;
97 overflow: visible;
98+ overflow-wrap: normal;
98 }
99 }
99 .sourceCode {
100 .sourceCode {
100 background-color: transparent;
101 background-color: transparent;
test/writer.latex+4−4
@@ -4,10 +4,6 @@
4%
4%
5\documentclass[
5\documentclass[
6]{article}
6]{article}
7−\title{Pandoc Test Suite}
8−\author{John MacFarlane \and Anonymous}
9−\date{July 17, 2006}
10−
11\usepackage{amsmath,amssymb}
7\usepackage{amsmath,amssymb}
12\usepackage{lmodern}
8\usepackage{lmodern}
13\usepackage{iftex}
9\usepackage{iftex}
@@ -71,6 +67,10 @@
71 \usepackage{selnolig} % disable illegal ligatures
67 \usepackage{selnolig} % disable illegal ligatures
72\fi
68\fi
73
69
70+\title{Pandoc Test Suite}
71+\author{John MacFarlane \and Anonymous}
72+\date{July 17, 2006}
73+
74\begin{document}
74\begin{document}
75\maketitle
75\maketitle
76
76
test/writers-lang-and-dir.latex+3−3
@@ -5,9 +5,6 @@
5\documentclass[
5\documentclass[
6 english,
6 english,
7]{article}
7]{article}
8−\author{}
9−\date{}
10−
11\usepackage{amsmath,amssymb}
8\usepackage{amsmath,amssymb}
12\usepackage{lmodern}
9\usepackage{lmodern}
13\usepackage{iftex}
10\usepackage{iftex}
@@ -87,6 +84,9 @@
87 \newenvironment{LTR}{\beginL}{\endL}
84 \newenvironment{LTR}{\beginL}{\endL}
88\fi
85\fi
89
86
87+\author{}
88+\date{}
89+
90\begin{document}
90\begin{document}
91
91
92\hypertarget{empty-divs-and-spans}{%
92\hypertarget{empty-divs-and-spans}{%
tools/build-arm.sh+3−1
@@ -1,6 +1,8 @@
1#!/bin/sh
1#!/bin/sh
2
2
3+#old version:
3−IMAGE_ID=ami-0fa8979d18f69948b
4+#IMAGE_ID=ami-0fa8979d18f69948b
5+IMAGE_ID=ami-0cd6b53a434812702
4INSTANCE_TYPE=t4g.2xlarge
6INSTANCE_TYPE=t4g.2xlarge
5KEY_NAME=debian-arm-us-east-2
7KEY_NAME=debian-arm-us-east-2
6SECURITY_GROUP_ID=sg-086ffbadc286c5c00
8SECURITY_GROUP_ID=sg-086ffbadc286c5c00