git.iko.soy/typeable/pandoc
on master help sign in
42 files changed+559−165
since splitsnapshots
unifiedsplit
.circleci/config.yml+1−1 cabal.project+9 changelog.md+27−1 data/templates/default.latex+29−29 data/templates/styles.html+2−1 doc/faqs.md+128 pandoc.cabal+1−1 src/Text/Pandoc/Citeproc.hs+63−39 src/Text/Pandoc/Citeproc/BibTeX.hs+4−2 src/Text/Pandoc/Error.hs+3−3 src/Text/Pandoc/ImageSize.hs+5−1 src/Text/Pandoc/Parsing.hs+1−1 src/Text/Pandoc/Readers/Metadata.hs+3 src/Text/Pandoc/Writers/Docx.hs+19−3 src/Text/Pandoc/Writers/Docx/Table.hs+28−3 src/Text/Pandoc/Writers/Docx/Types.hs+4 src/Text/Pandoc/Writers/HTML.hs+42−37 src/Text/Pandoc/Writers/LaTeX/Table.hs+5−2 src/Text/Pandoc/Writers/Markdown.hs+3 src/Text/Pandoc/Writers/Powerpoint/Output.hs+1 stack.yaml+5 test/Tests/Writers/OOXML.hs+3−1 test/command/4465.md+15 test/command/6890.md+2−2 test/command/7272.md+1−1 test/command/7394.md+85 test/command/7400.md+9 test/command/7416.md+19 test/command/pandoc-citeproc-322.md+1−1 test/command/pandoc-citeproc-chicago-author-date.md+7−7 test/command/pandoc-citeproc-chicago-fullnote-bibliography.md+6−7 test/docx/golden/image.docx test/lhs-test.html+2−1 test/lhs-test.html+lhs+2−1 test/lhs-test.latex+3−3 test/lhs-test.latex+lhs+3−3 test/tables/nordics.latex+4−4 test/writer.html4+2−1 test/writer.html5+2−1 test/writer.latex+4−4 test/writers-lang-and-dir.latex+3−3 tools/build-arm.sh+3−1
.circleci/config.yml+1−1
@@ -2,7 +2,7 @@ version: "2.1"
22jobs:
33 build:
44 macos:
5− xcode: 9.4.1
5+ xcode: 11.1.0
66 environment:
77 HOMEBREW_NO_AUTO_UPDATE: 1
88 steps:
cabal.project+9
@@ -2,3 +2,12 @@ packages: pandoc.cabal
22tests: True
33flags: +embed_data_files
44
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+27−1
@@ -1,11 +1,37 @@
11# Revision history for pandoc
22
3−## pandoc 2.14.0.3 (2021-06-20)
3+## pandoc 2.14.0.3 (2021-06-22)
44
55 * Text.Pandoc.MediaBag `insertMediaBag`: ensure we get a sane mediaPath
66 for URLs (#7391). In earlier 2.14.x versions, we'd get
77 incorrect paths for resources downloaded from URLs when the
88 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.
935 * Use lts-18.0 stack resolver.
1036 * Require skylighting 0.10.5.2 (adding support for Swift).
1137 * Require commonmark 0.2.1.
data/templates/default.latex+29−29
@@ -36,35 +36,6 @@ $for(classoption)$
3636 $classoption$$sep$,
3737$endfor$
3838]{$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−
6839$if(beamer)$
6940$if(background-image)$
7041\usebackgroundtemplate{%
@@ -452,6 +423,35 @@ $if(csquotes)$
452423\usepackage{csquotes}
453424$endif$
454425
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+
455455\begin{document}
456456$if(has-frontmatter)$
457457\frontmatter
data/templates/styles.html+2−1
@@ -14,7 +14,7 @@ body {
1414 padding-top: $if(margin-top)$$margin-top$$else$50px$endif$;
1515 padding-bottom: $if(margin-bottom)$$margin-bottom$$else$50px$endif$;
1616 hyphens: auto;
17− word-wrap: break-word;
17+ overflow-wrap: break-word;
1818 text-rendering: optimizeLegibility;
1919 font-kerning: normal;
2020}
@@ -93,6 +93,7 @@ $endif$
9393pre code {
9494 padding: 0;
9595 overflow: visible;
96+ overflow-wrap: normal;
9697}
9798.sourceCode {
9899 background-color: transparent;
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+
pandoc.cabal+1−1
@@ -453,7 +453,7 @@ library
453453 citeproc >= 0.4.0.1 && < 0.4.1,
454454 commonmark >= 0.2.1 && < 0.3,
455455 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,
457457 connection >= 0.3.1,
458458 containers >= 0.4.2.1 && < 0.7,
459459 data-default >= 0.4 && < 0.8,
src/Text/Pandoc/Citeproc.hs+63−39
@@ -27,7 +27,7 @@ import Text.Pandoc.Error (PandocError(..))
2727import Text.Pandoc.Extensions (pandocExtensions)
2828import Text.Pandoc.Logging (LogMessage(..))
2929import Text.Pandoc.Options (ReaderOptions(..))
30−import Text.Pandoc.Shared (stringify, ordNub, blocksToInlines, tshow)
30+import Text.Pandoc.Shared (stringify, ordNub, tshow)
3131import qualified Text.Pandoc.UTF8 as UTF8
3232import Text.Pandoc.Walk (query, walk, walkM)
3333import Control.Applicative ((<|>))
@@ -49,6 +49,7 @@ import qualified Data.Text as T
4949import System.FilePath (takeExtension)
5050import Safe (lastMay, initSafe)
5151
52+
5253processCitations :: PandocMonad m => Pandoc -> m Pandoc
5354processCitations (Pandoc meta bs) = do
5455 style <- getStyle (Pandoc meta bs)
@@ -90,22 +91,18 @@ processCitations (Pandoc meta bs) = do
9091 walk (convertQuotes locale) .
9192 insertSpace $ out)
9293 (resultBibliography result)
93− let moveNotes = maybe True truish $
94− lookupMeta "notes-after-punctuation" meta
94+ let moveNotes = styleIsNoteStyle sopts &&
95+ maybe True truish (lookupMeta "notes-after-punctuation" meta)
9596 let cits = map (walk (convertQuotes locale)) $
9697 resultCitations result
9798
98− let fixQuotes = case localePunctuationInQuote locale of
99− Just True ->
100− B.toList . movePunctuationInsideQuotes . B.fromList
101− _ -> id
102−
10399 let metanocites = lookupMeta "nocite" meta
104100 let Pandoc meta'' bs' =
105101 maybe id (setMeta "nocite") metanocites .
106− walk (map capitalizeNoteCitation .
107− fixQuotes . mvPunct moveNotes locale) .
108− walk deNote .
102+ walk (mvPunct moveNotes locale) .
103+ (if styleIsNoteStyle sopts
104+ then walk addNote . walk deNote
105+ else id) .
109106 evalState (walkM insertResolvedCitations $ Pandoc meta' bs)
110107 $ cits
111108 return $ Pandoc meta''
@@ -375,7 +372,6 @@ formatFromExtension fp = case dropWhile (== '.') $ takeExtension fp of
375372
376373
377374isNote :: Inline -> Bool
378−isNote (Note _) = True
379375isNote (Cite _ [Note _]) = True
380376 -- the following allows citation styles that are "in-text" but use superscript
381377 -- references to be treated as if they are "notes" for the purposes of moving
@@ -388,6 +384,12 @@ isSpacy Space = True
388384isSpacy SoftBreak = True
389385isSpacy _ = False
390386
387+movePunctInsideQuotes :: Locale -> [Inline] -> [Inline]
388+movePunctInsideQuotes locale
389+ | localePunctuationInQuote locale == Just True
390+ = B.toList . movePunctuationInsideQuotes . B.fromList
391+ | otherwise
392+ = id
391393
392394mvPunct :: Bool -> Locale -> [Inline] -> [Inline]
393395mvPunct moveNotes locale (x : xs)
@@ -400,7 +402,8 @@ mvPunct moveNotes locale (q : s : x : ys)
400402 in if moveNotes
401403 then if T.null spunct
402404 then q : x : mvPunct moveNotes locale ys
403− else q : Str spunct : x : mvPunct moveNotes locale
405+ else movePunctInsideQuotes locale
406+ [q , Str spunct , x] ++ mvPunct moveNotes locale
404407 (B.toList
405408 (dropTextWhile isPunctuation (B.fromList ys)))
406409 else q : x : mvPunct moveNotes locale ys
@@ -412,9 +415,10 @@ mvPunct moveNotes locale (Cite cs ils : ys)
412415 , moveNotes
413416 = let s = stringify ys
414417 spunct = T.takeWhile isPunctuation s
415− in Cite cs (init ils
416− ++ [Str spunct | not (endWithPunct False (init ils))]
417− ++ [last ils]) :
418+ in Cite cs (movePunctInsideQuotes locale $
419+ init ils
420+ ++ [Str spunct | not (endWithPunct False (init ils))]
421+ ++ [last ils]) :
418422 mvPunct moveNotes locale
419423 (B.toList (dropTextWhile isPunctuation (B.fromList ys)))
420424mvPunct moveNotes locale (s : x : ys) | isSpacy s, isNote x =
@@ -560,42 +564,62 @@ extractText (FancyVal x) = toText x
560564extractText (NumVal n) = T.pack (show n)
561565extractText _ = mempty
562566
563−capitalizeNoteCitation :: Inline -> Inline
564−capitalizeNoteCitation (Cite cs [Note [Para ils]]) =
565− Cite cs
566− [Note [Para $ B.toList $ addTextCase Nothing CapitalizeFirst
567− $ B.fromList ils]]
568−capitalizeNoteCitation x = x
569−
570−deNote :: [Inline] -> [Inline]
571−deNote [] = []
572−deNote (Note bs:rest) =
573− Note (walk go bs) : deNote rest
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.
570+addNote :: Inline -> Inline
571+addNote (Span ("",["csl-note"],[]) ils) =
572+ Note [Para $
573+ B.toList . addTextCase Nothing CapitalizeFirst . B.fromList $ ils]
574+addNote x = x
575+
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.
580+deNote :: Inline -> Inline
581+deNote (Note bs) =
582+ case bs of
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+
574589 where
575− go [] = []
576− go (Cite (c:cs) ils : zs)
590+ addParens [] = []
591+ addParens (Cite (c:cs) ils : zs)
577592 | citationMode c == AuthorInText
578− = Cite (c:cs) (concatMap (noteAfterComma (needsPeriod zs)) ils) : go zs
593+ = Cite (c:cs) (concatMap (noteAfterComma (needsPeriod zs)) ils) :
594+ addParens zs
579595 | otherwise
580− = Cite (c:cs) (concatMap noteInParens ils) : go zs
581− go (x:xs) = x : go xs
596+ = Cite (c:cs) (concatMap noteInParens ils) : addParens zs
597+ addParens (x:xs) = x : addParens xs
598+
599+ removeNotes (Span ("",["csl-note"],[]) ils) = Span ("",[],[]) ils
600+ removeNotes x = x
601+
582602 needsPeriod [] = True
583603 needsPeriod (Str t:_) = case T.uncons t of
584604 Nothing -> False
585605 Just (c,_) -> isUpper c
586606 needsPeriod (Space:zs) = needsPeriod zs
587607 needsPeriod _ = False
588− noteInParens (Note bs')
608+
609+ noteInParens (Span ("",["csl-note"],[]) ils)
589610 = Space : Str "(" :
590− removeFinalPeriod (blocksToInlines bs') ++ [Str ")"]
611+ removeFinalPeriod ils ++ [Str ")"]
591612 noteInParens x = [x]
592− noteAfterComma needsPer (Note bs')
613+
614+ noteAfterComma needsPer (Span ("",["csl-note"],[]) ils)
615+ | not (null ils)
593616 = Str "," : Space :
594− (if needsPer
595− then id
596− else removeFinalPeriod) (blocksToInlines bs')
617+ if needsPer
618+ then ils
619+ else removeFinalPeriod ils
597620 noteAfterComma _ x = [x]
598−deNote (x:xs) = x : deNote xs
621+
622+deNote x = x
599623
600624-- Note: we can't use dropTextWhileEnd indiscriminately,
601625-- 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
7171 filter (\item -> idpred (identifier item) &&
7272 entryType item /= "xdata"))
7373 (fromMaybe defaultLang $ localeLanguage locale, Map.empty)
74− "" (toSources contents) of
74+ (initialSourceName sources) sources of
7575 Left err -> Left err
7676 Right xs -> return xs
77+ where
78+ sources = toSources contents
7779
7880-- | Write BibTeX or BibLaTeX given given a 'Reference'.
7981writeBibtexString :: WriterOptions -- ^ options (for writing LaTex)
@@ -866,7 +868,7 @@ fieldName = resolveAlias . T.toLower
866868
867869isBibtexKeyChar :: Char -> Bool
868870isBibtexKeyChar c =
869− isAlphaNum c || c `elem` (".:;?!`'()/*@_+=-[]*&" :: [Char])
871+ isAlphaNum c || c `elem` (".:;?!`'()$/*@_+=-[]*&" :: [Char])
870872
871873bibItem :: BibParser Item
872874bibItem = do
src/Text/Pandoc/Error.hs+3−3
@@ -97,13 +97,13 @@ renderError e =
9797 [] -> ""
9898 ((pos,txt):_) ->
9999 let ls = T.lines txt <> [""]
100− ln = errLine - sourceLine pos
101− in if length ls > ln - 1
100+ ln = (errLine - sourceLine pos) + 1
101+ in if length ls > ln && ln >= 1
102102 then T.concat ["\n", ls !! (ln - 1)
103103 ,"\n", T.replicate (errColumn - 1) " "
104104 ,"^"]
105105 else ""
106− in "\nError at " <> tshow err' <> errorInFile
106+ in "Error at " <> tshow err' <> errorInFile
107107 PandocMakePDFError s -> s
108108 PandocOptionError s -> s
109109 PandocSyntaxMapError s -> s
src/Text/Pandoc/ImageSize.hs+5−1
@@ -57,7 +57,8 @@ import Codec.Picture (decodeImageWithMetadata)
5757-- quick and dirty functions to get image sizes
5858-- algorithms borrowed from wwwis.pl
5959
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
6162data Direction = Width | Height
6263instance Show Direction where
6364 show Width = "width"
@@ -100,6 +101,8 @@ imageType :: ByteString -> Maybe ImageType
100101imageType img = case B.take 4 img of
101102 "\x89\x50\x4e\x47" -> return Png
102103 "\x47\x49\x46\x38" -> return Gif
104+ "\x49\x49\x2a\x00" -> return Tiff
105+ "\x4D\x4D\x00\x2a" -> return Tiff
103106 "\xff\xd8\xff\xe0" -> return Jpeg -- JFIF
104107 "\xff\xd8\xff\xe1" -> return Jpeg -- Exif
105108 "%PDF" -> return Pdf
@@ -124,6 +127,7 @@ imageSize opts img = checkDpi <$>
124127 Just Png -> getSize img
125128 Just Gif -> getSize img
126129 Just Jpeg -> getSize img
130+ Just Tiff -> getSize img
127131 Just Svg -> mbToEither "could not determine SVG size" $ svgSize opts img
128132 Just Eps -> mbToEither "could not determine EPS size" $ epsSize img
129133 Just Pdf -> mbToEither "could not determine PDF size" $ pdfSize img
src/Text/Pandoc/Parsing.hs+1−1
@@ -188,7 +188,7 @@ import Control.Monad.Identity
188188import Control.Monad.Reader
189189 ( asks, runReader, MonadReader(ask), Reader, ReaderT(ReaderT) )
190190import Data.Char (chr, isAlphaNum, isAscii, isAsciiUpper, isAsciiLower,
191− isPunctuation, isSpace, ord, toLower, toUpper)
191+ isSpace, ord, toLower, toUpper)
192192import Data.Default ( Default(..) )
193193import Data.Functor (($>))
194194import Data.List (intercalate, transpose)
src/Text/Pandoc/Readers/Metadata.hs+3
@@ -45,6 +45,9 @@ yamlBsToMeta pMetaValue bstr = do
4545 Right [] -> return . return $ mempty
4646 Right [YAML.Doc (YAML.Scalar _ YAML.SNull)]
4747 -> 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
4851 Right _ -> Prelude.fail "expected YAML object"
4952 Left (yamlpos, err')
5053 -> do pos <- getPosition
src/Text/Pandoc/Writers/Docx.hs+19−3
@@ -36,7 +36,8 @@ import Data.Time.Clock.POSIX
3636import Data.Digest.Pure.SHA (sha1, showDigest)
3737import Skylighting
3838import 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
4041import qualified Text.Pandoc.Class.PandocMonad as P
4142import Data.Time
4243import Text.Pandoc.UTF8 (fromTextLazy)
@@ -854,14 +855,28 @@ blockToOpenXML' opts (Plain lst) = do
854855-- title beginning with fig: indicates that the image is a figure
855856blockToOpenXML' opts (Para [Image attr alt (src,T.stripPrefix "fig:" -> Just tit)]) = do
856857 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
857862 prop <- pStyleM $
858863 if null alt
859864 then "Figure"
860865 else "Captioned Figure"
861866 paraProps <- local (\env -> env { envParaProperties = EnvProps (Just prop) [] <> envParaProperties env }) (getParaProps False)
862867 contents <- inlinesToOpenXML opts [Image attr alt (src,tit)]
863− captionNode <- withParaPropM (pStyleM "Image Caption")
864− $ blockToOpenXML opts (Para alt)
868+ captionNode <- if null alt
869+ then return []
870+ else withParaPropM (pStyleM "Image Caption")
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)
865880 return $
866881 Elem (mknode "w:p" [] (map Elem paraProps ++ contents))
867882 : captionNode
@@ -1289,6 +1304,7 @@ inlineToOpenXML' opts (Image attr@(imgident, _, _) alt (src, title)) = do
12891304 Just Eps -> ".eps"
12901305 Just Svg -> ".svg"
12911306 Just Emf -> ".emf"
1307+ Just Tiff -> ".tiff"
12921308 Nothing -> ""
12931309 imgpath = "media/" <> ident <> imgext
12941310 mbMimeType = mt <|> getMimeType (T.unpack imgpath)
src/Text/Pandoc/Writers/Docx/Table.hs+28−3
@@ -17,7 +17,7 @@ import Control.Monad.State.Strict
1717import Data.Array
1818import Data.Text (Text)
1919import Text.Pandoc.Definition
20−import Text.Pandoc.Class.PandocMonad (PandocMonad)
20+import Text.Pandoc.Class.PandocMonad (PandocMonad, translateTerm)
2121import Text.Pandoc.Writers.Docx.Types
2222import Text.Pandoc.Shared
2323import Text.Printf (printf)
@@ -25,6 +25,7 @@ import Text.Pandoc.Writers.GridTable hiding (Table)
2525import Text.Pandoc.Writers.OOXML
2626import Text.Pandoc.XML.Light as XML hiding (Attr)
2727import qualified Data.Text as T
28+import qualified Text.Pandoc.Translations as Term
2829import qualified Text.Pandoc.Writers.GridTable as Grid
2930
3031tableToOpenXML :: PandocMonad m
@@ -33,15 +34,23 @@ tableToOpenXML :: PandocMonad m
3334 -> WS m [Content]
3435tableToOpenXML blocksToOpenXML gridTable = do
3536 setFirstPara
36− let (Grid.Table _attr caption colspecs _rowheads thead tbodies tfoot) =
37+ let (Grid.Table (ident,_,_) caption colspecs _rowheads thead tbodies tfoot) =
3738 gridTable
3839 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
3947 let captionStr = stringify captionBlocks
4048 let aligns = map fst $ elems colspecs
4149 captionXml <- if null captionBlocks
4250 then return []
4351 else withParaPropM (pStyleM "Table Caption")
44− $ blocksToOpenXML captionBlocks
52+ $ blocksToOpenXML
53+ $ addLabel tableid tablename tablenum captionBlocks
4554 -- We set "in table" after processing the caption, because we don't
4655 -- want the "Table Caption" style to be overwritten with "Compact".
4756 modify $ \s -> s { stInTable = True }
@@ -81,6 +90,22 @@ tableToOpenXML blocksToOpenXML gridTable = do
8190 modify $ \s -> s { stInTable = False }
8291 return $ captionXml ++ [Elem tbl]
8392
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+
84109-- | Parts of a table
85110data RowType = HeadRow | BodyRow | FootRow
86111
src/Text/Pandoc/Writers/Docx/Types.hs+4
@@ -117,6 +117,8 @@ data WriterState = WriterState{
117117 , stDynamicParaProps :: Set.Set ParaStyleName
118118 , stDynamicTextProps :: Set.Set CharStyleName
119119 , stCurId :: Int
120+ , stNextFigureNum :: Int
121+ , stNextTableNum :: Int
120122 }
121123
122124defaultWriterState :: WriterState
@@ -137,6 +139,8 @@ defaultWriterState = WriterState{
137139 , stDynamicParaProps = Set.empty
138140 , stDynamicTextProps = Set.empty
139141 , stCurId = 20
142+ , stNextFigureNum = 1
143+ , stNextTableNum = 1
140144 }
141145
142146setFirstPara :: PandocMonad m => WS m ()
src/Text/Pandoc/Writers/HTML.hs+42−37
@@ -26,8 +26,13 @@ module Text.Pandoc.Writers.HTML (
2626 writeSlideous,
2727 writeDZSlides,
2828 writeRevealJs,
29− tagWithAttributes
29+ tagWithAttributes,
30+ inlineToHtml,
31+ blockToHtml,
32+ WriterState(..),
33+ defaultWriterState
3034 ) where
35+
3136import Control.Monad.State.Strict
3237import Data.Char (ord)
3338import Data.List (intercalate, intersperse, partition, delete, (\\), foldl')
@@ -317,10 +322,6 @@ pandocToHtml opts (Pandoc meta blocks) = do
317322 | otherwise -> mempty
318323 Nothing -> mempty
319324 let mCss :: Maybe [Text] = lookupContext "css" metadata
320− let true :: Text
321− true = "true"
322− let false :: Text
323− false = "false"
324325 let context = (if stHighlighting st
325326 then case writerHighlightStyle opts of
326327 Just sty -> defField "highlighting-css"
@@ -351,43 +352,43 @@ pandocToHtml opts (Pandoc meta blocks) = do
351352 (if slideVariant == RevealJsSlides
352353 then -- set boolean options explicitly, since
353354 -- template can't distinguish False/undefined
354− defField "controls" true .
355− defField "controlsTutorial" true .
355+ defField "controls" True .
356+ defField "controlsTutorial" True .
356357 defField "controlsLayout" ("bottom-right" :: Text) .
357358 defField "controlsBackArrows" ("faded" :: Text) .
358− defField "progress" true .
359− defField "slideNumber" false .
359+ defField "progress" True .
360+ defField "slideNumber" False .
360361 defField "showSlideNumber" ("all" :: Text) .
361− defField "hashOneBasedIndex" false .
362− defField "hash" false .
363− defField "respondToHashChanges" true .
364− defField "history" false .
365− defField "keyboard" true .
366− defField "overview" true .
367− defField "disableLayout" false .
368− defField "center" true .
369− defField "touch" true .
370− defField "loop" false .
371− defField "rtl" false .
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 .
372373 defField "navigationMode" ("default" :: Text) .
373− defField "shuffle" false .
374− defField "fragments" true .
375− defField "fragmentInURL" true .
376− defField "embedded" false .
377− defField "help" true .
378− defField "pause" true .
379− defField "showNotes" false .
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 .
380381 defField "autoPlayMedia" ("null" :: Text) .
381382 defField "preloadIframes" ("null" :: Text) .
382383 defField "autoSlide" ("0" :: Text) .
383− defField "autoSlideStoppable" true .
384+ defField "autoSlideStoppable" True .
384385 defField "autoSlideMethod" ("null" :: Text) .
385386 defField "defaultTiming" ("null" :: Text) .
386− defField "mouseWheel" false .
387+ defField "mouseWheel" False .
387388 defField "display" ("block" :: Text) .
388− defField "hideInactiveCursor" true .
389+ defField "hideInactiveCursor" True .
389390 defField "hideCursorTime" ("5000" :: Text) .
390− defField "previewLinks" false .
391+ defField "previewLinks" False .
391392 defField "transition" ("slide" :: Text) .
392393 defField "transitionSpeed" ("default" :: Text) .
393394 defField "backgroundTransition" ("fade" :: Text) .
@@ -663,17 +664,20 @@ dimensionsToAttrList attr = consolidateStyles $ go Width ++ go Height
663664figure :: PandocMonad m
664665 => WriterOptions -> Attr -> [Inline] -> (Text, Text)
665666 -> StateT WriterState m Html
666−figure opts attr txt (s,tit) = do
667+figure opts attr@(_, _, attrList) txt (s,tit) = do
667668 html5 <- gets stHtml5
668669 -- Screen-readers will normally read the @alt@ text and the figure; we
669670 -- want to avoid them reading the same text twice. With HTML5 we can
670671 -- use aria-hidden for the caption; with HTML4, we use an empty
671672 -- alt-text instead.
673+ -- When the alt text differs from the caption both should be read.
672674 let alt = if html5 then txt else [Str ""]
673675 let tocapt = if html5
674− then H5.figcaption !
675− H5.customAttribute (textTag "aria-hidden")
676− (toValue @Text "true")
676+ then (H5.figcaption !) $
677+ if isJust (lookup "alt" attrList)
678+ then mempty
679+ else H5.customAttribute (textTag "aria-hidden")
680+ (toValue @Text "true")
677681 else H.p ! A.class_ "caption"
678682 img <- inlineToHtml opts (Image attr alt (s,tit))
679683 capt <- if null txt
@@ -1437,7 +1441,7 @@ inlineToHtml opts inline = do
14371441 return $ if T.null tit
14381442 then link'
14391443 else link' ! A.title (toValue tit)
1440− (Image attr txt (s,tit)) -> do
1444+ (Image attr@(_, _, attrList) txt (s, tit)) -> do
14411445 let alternate = stringify txt
14421446 slideVariant <- gets stSlideVariant
14431447 let isReveal = slideVariant == RevealJsSlides
@@ -1450,7 +1454,8 @@ inlineToHtml opts inline = do
14501454 [A.title $ toValue tit | not (T.null tit)] ++
14511455 attrs
14521456 imageTag = (if html5 then H5.img else H.img
1453− , [A.alt $ toValue alternate | not (null txt)] )
1457+ , [A.alt $ toValue alternate | not (null txt) &&
1458+ isNothing (lookup "alt" attrList)] )
14541459 mediaTag tg fallbackTxt =
14551460 let linkTxt = if null txt
14561461 then fallbackTxt
src/Text/Pandoc/Writers/LaTeX/Table.hs+5−2
@@ -264,10 +264,11 @@ cellToLaTeX blockListToLaTeX celltype annotatedCell = do
264264 _ -> False
265265 let hasLineBreak LineBreak = Any True
266266 hasLineBreak _ = Any False
267+ let hasLineBreaks = getAny $ query hasLineBreak blocks
267268 result <-
268269 if not hasWidths || (celltype /= HeaderCell
269270 && all isPlainOrPara blocks
270− && not (getAny (query hasLineBreak blocks)))
271+ && not hasLineBreaks)
271272 then
272273 blockListToLaTeX $ walk fixLineBreaks $ walk displayMathToInline blocks
273274 else do
@@ -280,7 +281,9 @@ cellToLaTeX blockListToLaTeX celltype annotatedCell = do
280281 let halign = literal $ alignCommand align
281282 return $ "\\begin{minipage}" <> valign <>
282283 braces "\\linewidth" <> halign <> cr <>
283− cellContents <> cr <>
284+ cellContents <>
285+ (if hasLineBreaks then "\\strut" else mempty)
286+ <> cr <>
284287 "\\end{minipage}"
285288 modify $ \st -> st{ stExternalNotes = externalNotes }
286289 when (rowspan /= RowSpan 1) $
src/Text/Pandoc/Writers/Markdown.hs+3
@@ -791,6 +791,9 @@ blockListToMarkdown opts blocks = do
791791 b1 : commentSep : fixBlocks (b2:bs)
792792 fixBlocks (Plain ils : bs@(RawBlock{}:_)) =
793793 Plain ils : fixBlocks bs
794+ fixBlocks (Plain ils : bs@(Div{}:_))
795+ | isEnabled Ext_fenced_divs opts =
796+ Para ils : fixBlocks bs
794797 fixBlocks (Plain ils : bs) | inlist =
795798 Plain ils : fixBlocks bs
796799 fixBlocks (Plain ils : bs) =
src/Text/Pandoc/Writers/Powerpoint/Output.hs+1
@@ -537,6 +537,7 @@ registerMedia fp caption = do
537537 Just Eps -> Just ".eps"
538538 Just Svg -> Just ".svg"
539539 Just Emf -> Just ".emf"
540+ Just Tiff -> Just ".tiff"
540541 Nothing -> Nothing
541542
542543 let newGlobalId = fromMaybe (maxGlobalId + 1) (M.lookup fp globalIds)
stack.yaml+5
@@ -8,8 +8,13 @@ packages:
88- '.'
99extra-deps:
1010- commonmark-0.2.1
11+- commonmark-pandoc-0.2.1.1
1112- skylighting-core-0.10.5.2
1213- skylighting-0.10.5.2
14+- git: https://github.com/jgm/doctemplates
15+ commit: 428c26d5303cf7a2b1051fe1ffd9aafe9ba71c81
16+- git: https://github.com/jgm/citeproc
17+ commit: 4ce0501cd6f9c86eee087afcf878c256e49b9615
1318ghc-options:
1419 "$locals": -fhide-source-paths -Wno-missing-home-modules
1520resolver: lts-18.0
test/Tests/Writers/OOXML.hs+3−1
@@ -55,7 +55,9 @@ testArchive :: (WriterOptions -> Pandoc -> PandocIO BL.ByteString)
5555 -> IO Archive
5656testArchive writerFn opts fp = do
5757 txt <- T.readFile fp
58− bs <- runIOorExplode $ readNative def txt >>= writerFn opts
58+ bs <- runIOorExplode $ do
59+ setTranslations "en-US"
60+ readNative def txt >>= writerFn opts
5961 return $ toArchive bs
6062
6163compareFileList :: FilePath -> Archive -> Archive -> Maybe String
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/6890.md+2−2
@@ -23,12 +23,12 @@ references:
2323
2424@fruchtel-sozialer-2013a
2525
26−Some text [^1].
26+Some text.[^1]
2727
2828[^1]: @fruchtel-sozialer-2013a
2929^D
3030[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)"]]]]
3232,Div ("refs",["references","csl-bib-body","hanging-indent"],[])
3333 [Div ("ref-fruchtel-sozialer-2013a",["csl-entry"],[])
3434 [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+1−1
@@ -20,7 +20,7 @@
2020\endhead
2121\begin{minipage}[t]{\linewidth}\raggedright
2222{ text\\
23−text2 }
23+text2 }\strut
2424\end{minipage} \\
2525\bottomrule
2626\end{longtable}
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/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:
1919 type: 'article-journal'
2020---
2121
22−Foo[@timmory__justice_1950].
22+Foo [@timmory__justice_1950].
2323^D
2424Foo.[^1]
2525
test/command/pandoc-citeproc-chicago-author-date.md+7−7
@@ -54,14 +54,14 @@ References {#references .unnumbered}
5454
5555([**nonexistent?**](#ref-nonexistent))
5656
57−[Doe](#ref-item1) ([2005](#ref-item1)) says blah.
57+Doe ([2005](#ref-item1)) says blah.
5858
59−[Doe](#ref-item1) ([2005, 30](#ref-item1)) says blah.
59+Doe ([2005, 30](#ref-item1)) says blah.
6060
61−[Doe](#ref-item1) ([2005, 30](#ref-item1), with suffix) says blah.
61+Doe ([2005, 30](#ref-item1), with suffix) says blah.
6262
63−[Doe](#ref-item1) ([2005](#ref-item1); [2006, 30](#ref-item2); see also
64−[Doe and Roe 2007](#ref-пункт3)) says blah.
63+Doe ([2005](#ref-item1); [2006, 30](#ref-item2); see also [Doe and Roe
64+2007](#ref-пункт3)) says blah.
6565
6666In a note.[^1]
6767
@@ -98,8 +98,8 @@ edited by Sam Smith. Oxford: Oxford University Press.
9898:::
9999:::
100100
101−[^1]: [Doe and Roe](#ref-пункт3) ([2007, 12](#ref-пункт3)) and a
102− citation without locators ([Doe and Roe 2007](#ref-пункт3)).
101+[^1]: Doe and Roe ([2007, 12](#ref-пункт3)) and a citation without
102+ locators ([Doe and Roe 2007](#ref-пункт3)).
103103
104104[^2]: Some citations (see [Doe 2005, chap. 3](#ref-item1);
105105 [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}
5555
5656[^2]
5757
58−[John Doe](#ref-item1)[^3] says blah.
58+John Doe[^3] says blah.
5959
60−[Doe](#ref-item1)[^4] says blah.
60+Doe[^4] says blah.
6161
62−[Doe](#ref-item1)[^5] says blah.
62+Doe[^5] says blah.
6363
64−[Doe](#ref-item1)[^6] says blah.
64+Doe[^6] says blah.
6565
6666In a note.[^7]
6767
@@ -112,9 +112,8 @@ Sam Smith. Oxford: Oxford University Press, 2007.
112112 Roe, "Why Water Is Wet," in *Third Book*, ed. Sam Smith (Oxford:
113113 Oxford University Press, 2007)](#ref-пункт3).
114114
115−[^7]: [Doe and Roe](#ref-пункт3), ["Why Water Is Wet," 12](#ref-пункт3)
116− and a citation without locators ([Doe and Roe, "Why Water Is
117− Wet"](#ref-пункт3)).
115+[^7]: Doe and Roe, ["Why Water Is Wet," 12](#ref-пункт3) and a citation
116+ without locators ([Doe and Roe, "Why Water Is Wet"](#ref-пункт3)).
118117
119118[^8]: See [Doe, *First Book*, chap. 3](#ref-item1); also [Doe and Roe,
120119 "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 @@
2121 padding-top: 50px;
2222 padding-bottom: 50px;
2323 hyphens: auto;
24− word-wrap: break-word;
24+ overflow-wrap: break-word;
2525 text-rendering: optimizeLegibility;
2626 font-kerning: normal;
2727 }
@@ -92,6 +92,7 @@
9292 pre code {
9393 padding: 0;
9494 overflow: visible;
95+ overflow-wrap: normal;
9596 }
9697 .sourceCode {
9798 background-color: transparent;
test/lhs-test.html+lhs+2−1
@@ -21,7 +21,7 @@
2121 padding-top: 50px;
2222 padding-bottom: 50px;
2323 hyphens: auto;
24− word-wrap: break-word;
24+ overflow-wrap: break-word;
2525 text-rendering: optimizeLegibility;
2626 font-kerning: normal;
2727 }
@@ -92,6 +92,7 @@
9292 pre code {
9393 padding: 0;
9494 overflow: visible;
95+ overflow-wrap: normal;
9596 }
9697 .sourceCode {
9798 background-color: transparent;
test/lhs-test.latex+3−3
@@ -4,9 +4,6 @@
44%
55\documentclass[
66]{article}
7−\author{}
8−\date{}
9−
107\usepackage{amsmath,amssymb}
118\usepackage{lmodern}
129\usepackage{iftex}
@@ -88,6 +85,9 @@
8885 \usepackage{selnolig} % disable illegal ligatures
8986\fi
9087
88+\author{}
89+\date{}
90+
9191\begin{document}
9292
9393\hypertarget{lhs-test}{%
test/lhs-test.latex+lhs+3−3
@@ -4,9 +4,6 @@
44%
55\documentclass[
66]{article}
7−\author{}
8−\date{}
9−
107\usepackage{amsmath,amssymb}
118\usepackage{lmodern}
129\usepackage{iftex}
@@ -55,6 +52,9 @@
5552 \usepackage{selnolig} % disable illegal ligatures
5653\fi
5754
55+\author{}
56+\date{}
57+
5858\begin{document}
5959
6060\hypertarget{lhs-test}{%
test/tables/nordics.latex+4−4
@@ -11,10 +11,10 @@ Name
1111Capital
1212\end{minipage} & \begin{minipage}[b]{\linewidth}\centering
1313Population\\
14−(in 2018)
14+(in 2018)\strut
1515\end{minipage} & \begin{minipage}[b]{\linewidth}\centering
1616Area\\
17−(in km\textsuperscript{2})
17+(in km\textsuperscript{2})\strut
1818\end{minipage} \\
1919\midrule
2020\endfirsthead
@@ -25,10 +25,10 @@ Name
2525Capital
2626\end{minipage} & \begin{minipage}[b]{\linewidth}\centering
2727Population\\
28−(in 2018)
28+(in 2018)\strut
2929\end{minipage} & \begin{minipage}[b]{\linewidth}\centering
3030Area\\
31−(in km\textsuperscript{2})
31+(in km\textsuperscript{2})\strut
3232\end{minipage} \\
3333\midrule
3434\endhead
test/writer.html4+2−1
@@ -24,7 +24,7 @@
2424 padding-top: 50px;
2525 padding-bottom: 50px;
2626 hyphens: auto;
27− word-wrap: break-word;
27+ overflow-wrap: break-word;
2828 text-rendering: optimizeLegibility;
2929 font-kerning: normal;
3030 }
@@ -95,6 +95,7 @@
9595 pre code {
9696 padding: 0;
9797 overflow: visible;
98+ overflow-wrap: normal;
9899 }
99100 .sourceCode {
100101 background-color: transparent;
test/writer.html5+2−1
@@ -24,7 +24,7 @@
2424 padding-top: 50px;
2525 padding-bottom: 50px;
2626 hyphens: auto;
27− word-wrap: break-word;
27+ overflow-wrap: break-word;
2828 text-rendering: optimizeLegibility;
2929 font-kerning: normal;
3030 }
@@ -95,6 +95,7 @@
9595 pre code {
9696 padding: 0;
9797 overflow: visible;
98+ overflow-wrap: normal;
9899 }
99100 .sourceCode {
100101 background-color: transparent;
test/writer.latex+4−4
@@ -4,10 +4,6 @@
44%
55\documentclass[
66]{article}
7−\title{Pandoc Test Suite}
8−\author{John MacFarlane \and Anonymous}
9−\date{July 17, 2006}
10−
117\usepackage{amsmath,amssymb}
128\usepackage{lmodern}
139\usepackage{iftex}
@@ -71,6 +67,10 @@
7167 \usepackage{selnolig} % disable illegal ligatures
7268\fi
7369
70+\title{Pandoc Test Suite}
71+\author{John MacFarlane \and Anonymous}
72+\date{July 17, 2006}
73+
7474\begin{document}
7575\maketitle
7676
test/writers-lang-and-dir.latex+3−3
@@ -5,9 +5,6 @@
55\documentclass[
66 english,
77]{article}
8−\author{}
9−\date{}
10−
118\usepackage{amsmath,amssymb}
129\usepackage{lmodern}
1310\usepackage{iftex}
@@ -87,6 +84,9 @@
8784 \newenvironment{LTR}{\beginL}{\endL}
8885\fi
8986
87+\author{}
88+\date{}
89+
9090\begin{document}
9191
9292\hypertarget{empty-divs-and-spans}{%
tools/build-arm.sh+3−1
@@ -1,6 +1,8 @@
11#!/bin/sh
22
3−IMAGE_ID=ami-0fa8979d18f69948b
3+#old version:
4+#IMAGE_ID=ami-0fa8979d18f69948b
5+IMAGE_ID=ami-0cd6b53a434812702
46INSTANCE_TYPE=t4g.2xlarge
57KEY_NAME=debian-arm-us-east-2
68SECURITY_GROUP_ID=sg-086ffbadc286c5c00