diff --git a/AUTHORS.md b/AUTHORS.md
--- a/AUTHORS.md
+++ b/AUTHORS.md
@@ -69,6 +69,7 @@
 - Cezary Drożak
 - Chandrahas77
 - Charanjit Singh
+- Charles Tapley Hoyt
 - Charlotte Koch
 - Chris Black
 - Christian Conkle
@@ -149,6 +150,7 @@
 - Gwern Branwen
 - Hamish Mackenzie
 - Hans-Peter Deifel
+- Hendrik Erz
 - Heiko Schlittermann
 - Henrik Tramberend
 - Henry de Valence
@@ -197,6 +199,7 @@
 - Jeroen de Haas
 - Jerry Sky
 - Jesse Rosenthal
+- Jez Cope
 - Joe Hermaszewski
 - Joe Hillenbrand
 - John KetzerX
@@ -246,6 +249,7 @@
 - Marc Schreiber
 - Marcin Serwin
 - Mario Lang
+- Mark Gardner
 - Mark Szepieniec
 - Mark Wright
 - Martin Joerg
@@ -349,6 +353,7 @@
 - Scott Morrison
 - Sebastian Talmon
 - Sebbones
+- Sen-wen Deng
 - Sergei Trofimovich
 - Sergey Astanin
 - Seth Speaks
@@ -366,6 +371,7 @@
 - Stephan Meijer
 - Stephen Altamirano
 - Stephen Huan
+- Stephen Reindl
 - Stéphane Guillou
 - Sukil Etxenike
 - Sukka
diff --git a/MANUAL.txt b/MANUAL.txt
--- a/MANUAL.txt
+++ b/MANUAL.txt
@@ -1,7 +1,7 @@
 ---
 title: Pandoc User's Guide
 author: John MacFarlane
-date: January 12, 2025
+date: February 9, 2025
 ---
 
 # Synopsis
@@ -1109,7 +1109,7 @@
 `--top-level-division=default`|`section`|`chapter`|`part`
 
 :   Treat top-level headings as the given division type in
-    LaTeX, ConTeXt, DocBook, and  TEI output. The hierarchy
+    LaTeX, ConTeXt, DocBook, and TEI output. The hierarchy
     order is part, chapter, then section; all headings are
     shifted such that the top-level heading becomes the
     specified type. The default behavior is to determine the
@@ -1122,6 +1122,11 @@
     headings to become `\part{..}`, while second-level headings
     remain as their default type.
 
+    In Docx output, this option adds section breaks before first-level
+    headings if `chapter` is selected, and before first- and second-level
+    headings if `part` is selected. Footnote numbers will restart
+    with each section break unless the reference doc modifies this.
+
 `-N`, `--number-sections=[true|false]`
 
 :   Number section headings in LaTeX, ConTeXt, HTML, Docx, ms, or EPUB
@@ -3032,6 +3037,19 @@
 :   produce a handout version of Beamer slides (with overlays condensed
     into single slides)
 
+`csquotes`
+:   load `csquotes` package and use `\enquote` or `\enquote*` for quoted text.
+
+`csquotesoptions`
+:   options to use for `csquotes` package (repeat for multiple options).
+
+`babeloptions`
+:   options to pass to the babel package (may be repeated for
+    multiple options). This defaults to `provide=*` if the main
+    language isn't a European language written with Latin or
+    Cyrillic script or Vietnamese. Most users will not need to
+    adjust the default setting.
+
 #### Fonts
 
 `fontenc`
@@ -7560,6 +7578,12 @@
            --pdf-engine-opt=--tagged-pdf ...
 
 See the prince documentation for more info.
+
+## Typst
+
+Typst 0.12 can produce PDF/A-2b:
+
+    pandoc --pdf-engine=typst --pdf-engine-opt=--pdf-standard=a-2b ...
 
 ## Word Processors
 
diff --git a/changelog.md b/changelog.md
--- a/changelog.md
+++ b/changelog.md
@@ -1,8 +1,151 @@
 # Revision history for pandoc
 
+## pandoc 3.6.3 (2025-02-09)
+
+  * Track wikilinks with a class instead of a title (Evan Silberman).
+    Previously wikilinks were distinguished by giving them the `title`
+    `wikilink`.  Now that we have link attributes, it makes more sense
+    to give them the `class` `wikilink`. This change affects all readers
+    and writers that support wikilinks.
+
+  * DocBook reader:
+
+    + Handle title inside `orderedlist` (#10594). Also some other
+      elements that allow title: `blockquote`, `calloutlist`, etc.
+    + Better handle `informalequation` (#10592, tombolano). Include `id`
+      attribute.
+    + Better handle `formalpara`, `example`, and `sidebar` (#8666, tombolano).
+      Include identifiers and titles in each case.
+
+  * Markdown reader:
+
+    + Simplify and fix normal citation parsing (#10584).
+      This fixes a bug that causes some normal citations to be
+      parsed as bracketed regular citations.
+
+  * ODT reader:
+
+    + Create Figure elements for images that are figures (#10567).
+    + Avoid producing spurious blockquotes in list items (#9505).
+    + Fix unwanted block quotes (#10575). Previously the reader created
+      block quotes whenever a paragraph was marked indented (even though
+      this just affects the first line). With this change we still
+      generate block quotes for content that has an altered left margin,
+      but not for indented paragraphs.
+
+  * Docx reader:
+
+    + Do not issue warning for comments with `+styles` (#10571, Stephen Reindl).
+
+  * LaTeX reader:
+
+    + Test \{,re}newcommand arguments (#4470, Evan Silberman).
+
+  * Pod reader:
+
+    + Consume blanks after =encoding in pod reader (#10537, Evan Silberman).
+
+  * JATS writer:
+
+    + Add CRediT roles to JATS (Charles Tapley Hoyt and Jez Cope, #10152).
+      Enable annotating author roles using the Contribution Role Taxonomy
+      (CRediT) and export this information in conformant JATS.
+
+  * LaTeX writer/templates:
+
+    + Improve babel support (#8283). Previously we used the `.ini`
+      files for every language, but for European languages these tend to
+      provide inferior results to the `.ldf` files used by classic
+      Babel. Currently Babel documentation recommends using the classic
+      system for European languages written in Latin and Cyrillic
+      scripts and Vietnamese. So the LaTeX writer and template now
+      follow this guidance.
+
+      Main languages in the list of languages with good "classic" support
+      are added to global documentclass options and will be automatically
+      handled by Babel using the `.ldf` files.
+
+      If the main language is not in this list, the `babeloptions` variable
+      will be set to `provide=*`, which will cause support to be loaded from
+      the `.ini` file rather than an `.ldf`. So, for example, setting
+      `-V babeloptions=''` with a polytonic Greek document will cause the
+      `.ldf` support to be used instead of the `.ini`.
+
+      The default setting of this variable can be overwritten, but in most
+      cases the default should give good results.
+
+    + Allow `csquotesoptions` to be specified.
+    + Fix indentation bugs in `font-settings.latex`.
+
+  * Docx writer:
+
+    + Repeat reference doc's `sectPr` for each new section (#10577).
+      Previously we were only carrying over the reference doc's `sectPr`
+      at the end of the document, so it wouldn't affect the intermediate
+      sections that are now added if `--top-level-division` is `chapter`
+      or `part`. This could lead to bad results (e.g. page numbering
+      starting only on the last chapter).
+    + Create section divisions with `--top-level-division=part` (#10576).
+    + Improve title style in reference.docx; base Author and Date
+      on Title; remove condensed spacing (Andrew Dunning, #10581).
+
+  * Typst writer:
+
+    + Brace tables with `typst:no-figure` and `typst:text` attributes (#10563,
+      Gordon Woodhull).
+
+  * Ms writer:
+
+    + Fix escaping of `-` (#10536). `-` should now be escaped in man
+      output but not in ms output (where `\-` is a unicode minus sign).
+
+  * HTML styles: fix style of `hr` so it works when printed (#10535, Hendrik Erz).
+    Previously `background-color` was used to style the hr, but this gets ignored
+    when printing.  This commit uses `border-top` instead.
+
+  * Text.Pandoc.Shared:
+
+    + Handle `<abbr>` as a span-like inline in `htmlSpanLikeElements`
+      (#5793, Evan Silberman).
+
+  * Text.Pandoc.MediaBag:
+
+    + Prefer MIME type when determining extensions for MediaBag items (#10557,
+      Max Heller).  This should give different results for remote images
+      that are served at URLs that do not contain misleading extensions
+      (e.g. `shields.io`).
+
+  * Text.Pandoc.Citeproc:
+
+    + Fix moving punctuation before citation notes. This previously worked with
+      regular citations, but not author-in-text citations. Now it works with both.
+
+  * `doc/lua-filters.md`:
+
+    + Correct luacheck URL (#10589, R. N. West).
+    + Add static analysis paragraph to debugging section (#10568, R. N. West).
+    + Add note about extensions handling in `read` and `write` (Albert Krewinkel).
+
+  * `doc/extras.md`:
+
+    + Add entry for pandoc-subfigs (R. N. West).
+    + Update diagram Lua filter URL and description (R. N. West).
+
+  * MANUAL.txt:
+
+    + Add note on using typst to produce pdf/a-2b.
+    + Document top-level-division functionality with Docx (#10579, Andrew Dunning).
+
+  * Raise xml-conduit upper bound.
+
+  * Depend on latest commonmark-pandoc, commonmark-extensions,
+    citeproc, typst.
+
+  * Makefile: make `make binpath` quiet.
+
 ## pandoc 3.6.2 (2025-01-12)
 
-  * New output format: `pod` (Evan Silberman). Pod ("Plain old documentation")
+  * New input format: `pod` (Evan Silberman). Pod ("Plain old documentation")
     is a markup languaged used principally to document Perl modules and
     programs.
 
diff --git a/data/docx/word/styles.xml b/data/docx/word/styles.xml
--- a/data/docx/word/styles.xml
+++ b/data/docx/word/styles.xml
@@ -60,8 +60,6 @@
       <w:rFonts w:asciiTheme="majorHAnsi"
       w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi"
       w:cstheme="majorBidi" />
-      <w:spacing w:val="-10" />
-      <w:kern w:val="28" />
       <w:sz w:val="56" />
       <w:szCs w:val="56" />
     </w:rPr>
@@ -77,8 +75,6 @@
       <w:rFonts w:asciiTheme="majorHAnsi"
       w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi"
       w:cstheme="majorBidi" />
-      <w:spacing w:val="-10" />
-      <w:kern w:val="28" />
       <w:sz w:val="56" />
       <w:szCs w:val="56" />
     </w:rPr>
@@ -123,23 +119,31 @@
   </w:style>
   <w:style w:type="paragraph" w:customStyle="1" w:styleId="Author">
     <w:name w:val="Author" />
+    <w:basedOn w:val="Title" />
     <w:next w:val="BodyText" />
     <w:qFormat />
     <w:pPr>
       <w:keepNext />
       <w:keepLines />
-      <w:jc w:val="center" />
     </w:pPr>
+    <w:rPr>
+      <w:sz w:val="24" />
+      <w:szCs w:val="24" />
+    </w:rPr>
   </w:style>
   <w:style w:type="paragraph" w:styleId="Date">
     <w:name w:val="Date" />
+    <w:basedOn w:val="Title" />
     <w:next w:val="BodyText" />
     <w:qFormat />
     <w:pPr>
       <w:keepNext />
       <w:keepLines />
-      <w:jc w:val="center" />
     </w:pPr>
+    <w:rPr>
+      <w:sz w:val="24" />
+      <w:szCs w:val="24" />
+    </w:rPr>
   </w:style>
   <w:style w:type="paragraph" w:customStyle="1" w:styleId="AbstractTitle">
     <w:name w:val="Abstract Title" />
diff --git a/data/templates/article.jats_publishing b/data/templates/article.jats_publishing
--- a/data/templates/article.jats_publishing
+++ b/data/templates/article.jats_publishing
@@ -109,6 +109,17 @@
 $else$
 <string-name>$author$</string-name>
 $endif$
+$for(author.roles)$
+$if(it.credit)$
+<role vocab="credit"$if(it.degree)$ degree-contribution="$it.degree$"$endif$
+      vocab-identifier="https://credit.niso.org/"
+      vocab-term-identifier="https://credit.niso.org/contributor-roles/$it.credit$/"
+      vocab-term="$it.credit-name$"
+>$if(it.name)$$it.name$$else$$it.credit-name$$endif$</role>
+$elseif(it.name)$
+<role>$it.name$</role>
+$endif$
+$endfor$
 $if(author.email)$
 <email>$author.email$</email>
 $endif$
diff --git a/data/templates/common.latex b/data/templates/common.latex
--- a/data/templates/common.latex
+++ b/data/templates/common.latex
@@ -183,12 +183,11 @@
 $--
 $if(lang)$
 \ifLuaTeX
-\usepackage[bidi=basic]{babel}
+\usepackage[bidi=basic$for(babeloptions)$,$babeloptions$$endfor$]{babel}
 \else
-\usepackage[bidi=default]{babel}
+\usepackage[bidi=default$for(babeloptions)$,$babeloptions$$endfor$]{babel}
 \fi
 $if(babel-lang)$
-\babelprovide[main,import]{$babel-lang$}
 $if(mainfont)$
 \ifPDFTeX
 \else
@@ -196,9 +195,6 @@
 \fi
 $endif$
 $endif$
-$for(babel-otherlangs)$
-\babelprovide[import]{$babel-otherlangs$}
-$endfor$
 $for(babelfonts/pairs)$
 \babelfont[$babelfonts.key$]{rm}{$babelfonts.value$}
 $endfor$
@@ -261,5 +257,5 @@
 $-- csquotes
 $--
 $if(csquotes)$
-\usepackage{csquotes}
+\usepackage[$for(csquotesoptions)$$csquotesoptions$$sep$,$endfor$]{csquotes}
 $endif$
diff --git a/data/templates/default.latex b/data/templates/default.latex
--- a/data/templates/default.latex
+++ b/data/templates/default.latex
@@ -1,5 +1,11 @@
 $passoptions.latex()$
 \documentclass[
+$for(babel-otherlangs)$
+  $babel-otherlangs$,
+$endfor$
+$if(babel-lang)$
+  $babel-lang$,
+$endif$
 $if(fontsize)$
   $fontsize$,
 $endif$
diff --git a/data/templates/default.openxml b/data/templates/default.openxml
--- a/data/templates/default.openxml
+++ b/data/templates/default.openxml
@@ -60,15 +60,6 @@
 $for(include-after)$
     $include-after$
 $endfor$
-$-- sectpr will be set to the last sectpr in a reference.docx, if present
-$if(sectpr)$
     $sectpr$
-$else$
-    <w:sectPr>
-      <w:footnotePr>
-        <w:numRestart w:val="eachSect" />
-      </w:footnotePr>
-    </w:sectPr>
-$endif$
   </w:body>
 </w:document>
diff --git a/data/templates/font-settings.latex b/data/templates/font-settings.latex
--- a/data/templates/font-settings.latex
+++ b/data/templates/font-settings.latex
@@ -5,36 +5,36 @@
 \ifPDFTeX\else
   % xetex/luatex font selection
 $if(mainfont)$
-  $if(mainfontfallback)$
-    \ifLuaTeX
-      \usepackage{luaotfload}
-      \directlua{luaotfload.add_fallback("mainfontfallback",{
-        $for(mainfontfallback)$"$mainfontfallback$"$sep$,$endfor$
-      })}
-    \fi
-  $endif$
+$if(mainfontfallback)$
+  \ifLuaTeX
+    \usepackage{luaotfload}
+    \directlua{luaotfload.add_fallback("mainfontfallback",{
+      $for(mainfontfallback)$"$mainfontfallback$"$sep$,$endfor$
+    })}
+  \fi
+$endif$
   \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$$if(mainfontfallback)$,RawFeature={fallback=mainfontfallback}$endif$]{$mainfont$}
 $endif$
 $if(sansfont)$
-  $if(sansfontfallback)$
-    \ifLuaTeX
-      \usepackage{luaotfload}
-      \directlua{luaotfload.add_fallback("sansfontfallback",{
-        $for(sansfontfallback)$"$sansfontfallback$"$sep$,$endfor$
-      })}
-    \fi
-  $endif$
+$if(sansfontfallback)$
+  \ifLuaTeX
+    \usepackage{luaotfload}
+    \directlua{luaotfload.add_fallback("sansfontfallback",{
+      $for(sansfontfallback)$"$sansfontfallback$"$sep$,$endfor$
+    })}
+  \fi
+$endif$
   \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$$if(sansfontfallback)$,RawFeature={fallback=sansfontfallback}$endif$]{$sansfont$}
 $endif$
 $if(monofont)$
-  $if(monofontfallback)$
-    \ifLuaTeX
-      \usepackage{luaotfload}
-      \directlua{luaotfload.add_fallback("monofontfallback",{
-        $for(monofontfallback)$"$monofontfallback$"$sep$,$endfor$
-      })}
-    \fi
-  $endif$
+$if(monofontfallback)$
+  \ifLuaTeX
+    \usepackage{luaotfload}
+    \directlua{luaotfload.add_fallback("monofontfallback",{
+      $for(monofontfallback)$"$monofontfallback$"$sep$,$endfor$
+    })}
+  \fi
+$endif$
   \setmonofont[$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$if(monofontfallback)$,RawFeature={fallback=monofontfallback}$endif$]{$monofont$}
 $endif$
 $for(fontfamilies)$
@@ -55,12 +55,12 @@
   \ifXeTeX
     \usepackage{xeCJK}
     \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
-    $if(CJKsansfont)$
-      \setCJKsansfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKsansfont$}
-    $endif$
-    $if(CJKmonofont)$
-      \setCJKmonofont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmonofont$}
-    $endif$
+$if(CJKsansfont)$
+    \setCJKsansfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKsansfont$}
+$endif$
+$if(CJKmonofont)$
+    \setCJKmonofont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmonofont$}
+$endif$
   \fi
 $endif$
 $if(luatexjapresetoptions)$
diff --git a/data/templates/styles.html b/data/templates/styles.html
--- a/data/templates/styles.html
+++ b/data/templates/styles.html
@@ -130,8 +130,8 @@
  overflow: visible;
 }
 hr {
-  background-color: #1a1a1a;
   border: none;
+  border-top: 1px solid #1a1a1a;
   height: 1px;
   margin: 1em 0;
 }
diff --git a/pandoc.cabal b/pandoc.cabal
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -1,6 +1,6 @@
 cabal-version:   2.4
 name:            pandoc
-version:         3.6.2
+version:         3.6.3
 build-type:      Simple
 license:         GPL-2.0-or-later
 license-file:    COPYING.md
@@ -206,10 +206,12 @@
                  citeproc/biblatex-localization/*.lbx.strings
                  -- documentation
                  MANUAL.txt, COPYRIGHT
+extra-doc-files:
+                 changelog.md
 extra-source-files:
                  -- documentation
                  INSTALL.md, AUTHORS.md, README.md,
-                 CONTRIBUTING.md, BUGS, changelog.md,
+                 CONTRIBUTING.md, BUGS,
                  -- tests
                  test/bodybg.gif
                  test/*.native
@@ -429,7 +431,7 @@
                  test/pod-reader.pod
 source-repository head
   type:          git
-  location:      git://github.com/jgm/pandoc.git
+  location:      https://github.com/jgm/pandoc.git
 
 flag embed_data_files
   Description:   Embed data files in binary for relocatable executable.
@@ -466,7 +468,7 @@
 library xml-light
   import:        common-options
   build-depends: xml                   >= 1.3.12   && < 1.4,
-                 xml-conduit           >= 1.9.1.1  && < 1.10,
+                 xml-conduit           >= 1.9.1.1  && < 1.11,
                  xml-types             >= 0.3      && < 0.4,
                  containers            >= 0.6.0.1  && < 0.8,
                  text                  >= 1.1.1.0  && < 2.2
@@ -492,10 +494,10 @@
                  blaze-markup          >= 0.8      && < 0.9,
                  bytestring            >= 0.9      && < 0.13,
                  case-insensitive      >= 1.2      && < 1.3,
-                 citeproc              >= 0.8.1.2  && < 0.9,
+                 citeproc              >= 0.8.1.3  && < 0.9,
                  commonmark            >= 0.2.6.1  && < 0.3,
-                 commonmark-extensions >= 0.2.5.6  && < 0.3,
-                 commonmark-pandoc     >= 0.2.2.3  && < 0.3,
+                 commonmark-extensions >= 0.2.6    && < 0.3,
+                 commonmark-pandoc     >= 0.2.3    && < 0.3,
                  containers            >= 0.6.0.1  && < 0.8,
                  crypton               >= 0.30     && < 1.1,
                  crypton-connection    >= 0.3.1    && < 0.5,
@@ -544,7 +546,7 @@
                  zip-archive           >= 0.4.3.1  && < 0.5,
                  zlib                  >= 0.5      && < 0.8,
                  xml                   >= 1.3.12   && < 1.4,
-                 typst                 >= 0.6.1    && < 0.6.2,
+                 typst                 >= 0.6.2    && < 0.6.3,
                  vector                >= 0.12     && < 0.14,
                  djot                  >= 0.1.2.2  && < 0.2,
                  tls                   >= 2.0.1    && < 2.2,
diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs
--- a/src/Text/Pandoc/Citeproc.hs
+++ b/src/Text/Pandoc/Citeproc.hs
@@ -382,12 +382,12 @@
             _ -> Nothing
 
 isNote :: Inline -> Bool
-isNote (Cite _ [Note _]) = True
- -- the following allows citation styles that are "in-text" but use superscript
- -- references to be treated as if they are "notes" for the purposes of moving
- -- the citations after trailing punctuation (see <https://github.com/jgm/pandoc-citeproc/issues/382>):
-isNote (Cite _ [Superscript _]) = True
-isNote _                 = False
+isNote (Note _) = True
+-- the following allows citation styles that are "in-text" but use superscript
+-- references to be treated as if they are "notes" for the purposes of moving
+-- the citations after trailing punctuation (see <https://github.com/jgm/pandoc-citeproc/issues/382>):
+isNote (Superscript _) = True
+isNote _ = False
 
 isSpacy :: Inline -> Bool
 isSpacy Space     = True
@@ -405,9 +405,9 @@
 mvPunct moveNotes locale (x : xs)
   | isSpacy x = x : mvPunct moveNotes locale xs
 -- 'x [^1],' -> 'x,[^1]'
-mvPunct moveNotes locale (q : s : x : ys)
+mvPunct moveNotes locale (q : s : x@(Cite _ [il]) : ys)
   | isSpacy s
-  , isNote x
+  , isNote il
   = let spunct = T.takeWhile isPunctuation $ stringify ys
     in  if moveNotes
            then if T.null spunct
@@ -418,9 +418,8 @@
                           (dropTextWhile isPunctuation (B.fromList ys)))
            else q : x : mvPunct moveNotes locale ys
 -- 'x[^1],' -> 'x,[^1]'
-mvPunct moveNotes locale (Cite cs ils : ys)
-   | not (null ils)
-   , isNote (last ils)
+mvPunct moveNotes locale (Cite cs ils@(_:_) : ys)
+   | isNote (last ils)
    , startWithPunct ys
    , moveNotes
    = let s = stringify ys
@@ -431,8 +430,10 @@
                     ++ [last ils]) :
          mvPunct moveNotes locale
            (B.toList (dropTextWhile isPunctuation (B.fromList ys)))
-mvPunct moveNotes locale (s : x : ys) | isSpacy s, isNote x =
-  x : mvPunct moveNotes locale ys
+mvPunct moveNotes locale (s : x@(Cite _ [il]) : ys)
+  | isSpacy s
+  , isNote il
+  = x : mvPunct moveNotes locale ys
 mvPunct moveNotes locale (s : x@(Cite _ (Superscript _ : _)) : ys)
   | isSpacy s = x : mvPunct moveNotes locale ys
 mvPunct moveNotes locale (Cite cs ils : Str "." : ys)
diff --git a/src/Text/Pandoc/MediaBag.hs b/src/Text/Pandoc/MediaBag.hs
--- a/src/Text/Pandoc/MediaBag.hs
+++ b/src/Text/Pandoc/MediaBag.hs
@@ -107,9 +107,11 @@
                   _     -> getMimeTypeDef fp''
   mt = fromMaybe fallback mbMime
   path = maybe fp'' (unEscapeString . uriPath) uri
-  ext = case takeExtension path of
-          '.':e | '%' `notElem` e -> '.':e
-          _ -> maybe "" (\x -> '.':T.unpack x) $ extensionFromMimeType mt
+  ext = case extensionFromMimeType mt of
+             Just e -> '.':T.unpack e
+             Nothing -> case takeExtension path of
+                             '.':e | '%' `notElem` e -> '.':e
+                             _ -> ""
 
 -- | Lookup a media item in a 'MediaBag', returning mime type and contents.
 lookupMedia :: FilePath
diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs
--- a/src/Text/Pandoc/Readers/DocBook.hs
+++ b/src/Text/Pandoc/Readers/DocBook.hs
@@ -797,6 +797,9 @@
 admonitionTags :: [Text]
 admonitionTags = ["caution","danger","important","note","tip","warning"]
 
+titledBlockElements :: [Text]
+titledBlockElements = ["example", "formalpara", "sidebar"]
+
 -- Trim leading and trailing newline characters
 trimNl :: Text -> Text
 trimNl = T.dropAround (== '\n')
@@ -860,16 +863,10 @@
         "toc"   -> skip -- skip TOC, since in pandoc it's autogenerated
         "index" -> skip -- skip index, since page numbers meaningless
         "para"  -> parseMixed para (elContent e)
-        "formalpara" -> do
-           tit <- case filterChild (named "title") e of
-                        Just t  -> divWith ("",["formalpara-title"],[]) .
-                                   para .  strong <$> getInlines t
-                        Nothing -> return mempty
-           (tit <>) <$> parseMixed para (elContent e)
         "simpara"  -> parseMixed para (elContent e)
         "ackno"  -> parseMixed para (elContent e)
         "epigraph" -> parseBlockquote
-        "blockquote" -> parseBlockquote
+        "blockquote" -> withOptionalTitle parseBlockquote
         "attribution" -> skip
         "titleabbrev" -> skip
         "authorinitials" -> skip
@@ -882,7 +879,8 @@
         "bibliomisc" -> parseMixed para (elContent e)
         "bibliomixed" -> parseMixed para (elContent e)
         "equation"         -> para <$> equation e displayMath
-        "informalequation" -> para <$> equation e displayMath
+        "informalequation" -> divWith (attrValue "id" e,["informalequation"],[]) .
+                              para <$> equation e displayMath
         "glosssee" -> para . (\ils -> text "See " <> ils <> str ".")
                          <$> getInlines e
         "glossseealso" -> para . (\ils -> text "See also " <> ils <> str ".")
@@ -910,6 +908,7 @@
         "refsect2" -> sect 2
         "refsect3" -> sect 3
         "refsection" -> gets dbSectionLevel >>= sect . (+1)
+        l | l `elem` titledBlockElements -> parseAdmonition l
         l | l `elem` admonitionTags -> parseAdmonition l
         "area" -> skip
         "areaset" -> skip
@@ -918,9 +917,10 @@
         "question" -> addToStart (strong (str "Q:") <> str " ") <$> getBlocks e
         "answer" -> addToStart (strong (str "A:") <> str " ") <$> getBlocks e
         "abstract" -> blockQuote <$> getBlocks e
-        "calloutlist" -> bulletList <$> callouts
-        "itemizedlist" -> bulletList . handleCompact <$> listitems
-        "orderedlist" -> do
+        "calloutlist" -> withOptionalTitle $ bulletList <$> callouts
+        "itemizedlist" -> withOptionalTitle $
+                            bulletList . handleCompact <$> listitems
+        "orderedlist" -> withOptionalTitle $ do
           let listStyle = case attrValue "numeration" e of
                                "arabic"     -> Decimal
                                "loweralpha" -> LowerAlpha
@@ -981,6 +981,7 @@
            lift $ report $ IgnoredElement name
            return mempty
 
+
          compactSpacing = case attrValue "spacing" e of
                             "compact" -> True
                             _         -> False
@@ -1106,23 +1107,34 @@
              Just t  -> Just ("titleabbrev", strContentRecursive t)
              Nothing -> Nothing
          lineItems = mapM getInlines $ filterChildren (named "line") e
+
+         -- <title> elements can be directly nested inside an admonition block, use
+         -- it if it's there. It is unclear whether we should include the label in
+         -- the title: docbook references are ambiguous on that, and some implementations of admonitions
+         -- (e.g. asciidoctor) just use an icon in all cases. To be conservative, we don't
+         -- include the label and leave it to styling.
+         --
+         getTitle = case filterChild (named "title") e of
+                        Just t  -> Just <$> getInlines t
+                        Nothing -> return Nothing
+         withOptionalTitle p = do
+           mbt <- getTitle
+           b <- p
+           case mbt of
+             Nothing -> return b
+             Just t -> return $ divWith (attrValue "id" e,[],[])
+                         (divWith ("", ["title"], []) (plain t) <> b)
+
          -- Admonitions are parsed into a div. Following other Docbook tools that output HTML,
          -- we parse the optional title as a div with the @title@ class, and give the
          -- block itself a class corresponding to the admonition name.
          parseAdmonition label = do
-           -- <title> elements can be directly nested inside an admonition block, use
-           -- it if it's there. It is unclear whether we should include the label in
-           -- the title: docbook references are ambiguous on that, and some implementations of admonitions
-           -- (e.g. asciidoctor) just use an icon in all cases. To be conservative, we don't
-           -- include the label and leave it to styling.
-           title <- divWith ("", ["title"], []) . plain <$>
-                    case filterChild (named "title") e of
-                        Just t  -> getInlines t
-                        Nothing -> return mempty
-           -- this will ignore the title element if it is present
+           mbt <- getTitle
+           -- this will ignore the title element if it is present:
            b <- getBlocks e
+           let t = divWith ("", ["title"], []) (plain $ fromMaybe mempty mbt)
            -- we also attach the label as a class, so it can be styled properly
-           return $ divWith (attrValue "id" e,[label],[]) (title <> b)
+           return $ divWith (attrValue "id" e,[label],[]) (t <> b)
 
 toAlignment :: Element -> Alignment
 toAlignment c = case findAttr (unqual "align") c of
diff --git a/src/Text/Pandoc/Readers/Docx.hs b/src/Text/Pandoc/Readers/Docx.hs
--- a/src/Text/Pandoc/Readers/Docx.hs
+++ b/src/Text/Pandoc/Readers/Docx.hs
@@ -357,9 +357,10 @@
 blocksToInlinesWarn :: PandocMonad m => T.Text -> Blocks -> DocxContext m Inlines
 blocksToInlinesWarn cmtId blks = do
   let paraOrPlain :: Block -> Bool
-      paraOrPlain (Para _)  = True
-      paraOrPlain (Plain _) = True
-      paraOrPlain _         = False
+      paraOrPlain (Para _)       = True
+      paraOrPlain (Plain _)      = True
+      paraOrPlain (Div _ nested) = all paraOrPlain nested
+      paraOrPlain _              = False
   unless (all paraOrPlain blks) $
     lift $ P.report $ DocxParserWarning $
       "Docx comment " <> cmtId <> " will not retain formatting"
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -1859,6 +1859,7 @@
   => (Attr -> Text -> Text -> Inlines -> Inlines)
   -> MarkdownParser m (F Inlines)
 wikilink constructor = do
+  let attr = (mempty, ["wikilink"], mempty)
   titleAfter <-
     (True <$ guardEnabled Ext_wikilinks_title_after_pipe) <|>
     (False <$ guardEnabled Ext_wikilinks_title_before_pipe)
@@ -1871,7 +1872,7 @@
             | titleAfter -> (T.drop 1 after, before)
             | otherwise -> (before, T.drop 1 after)
     guard $ T.all (`notElem` ['\n','\r','\f','\t']) url
-    return . pure . constructor nullAttr url "wikilink" $
+    return . pure . constructor attr url "" $
        B.text $ fromEntities title
 
 link :: PandocMonad m => MarkdownParser m (F Inlines)
@@ -2267,7 +2268,11 @@
 
 normalCite :: PandocMonad m => MarkdownParser m (F [Citation])
 normalCite = try $ do
-  citations <- inBalancedBrackets (spnl *> citeList <* spnl)
+  char '['
+  spnl
+  citations <- citeList
+  spnl
+  char ']'
   -- not a link or a bracketed span
   notFollowedBy (try (void source) <|>
                   (guardEnabled Ext_bracketed_spans *> void attributes) <|>
diff --git a/src/Text/Pandoc/Readers/MediaWiki.hs b/src/Text/Pandoc/Readers/MediaWiki.hs
--- a/src/Text/Pandoc/Readers/MediaWiki.hs
+++ b/src/Text/Pandoc/Readers/MediaWiki.hs
@@ -667,7 +667,7 @@
   sym "]]"
   -- see #8525:
   linktrail <- B.text <$> manyChar (satisfy (\c -> isLetter c && not (isCJK c)))
-  let link = B.link (addUnderscores pagename) "wikilink" (label <> linktrail)
+  let link = B.linkWith (mempty, ["wikilink"], mempty) (addUnderscores pagename) (stringify label) (label <> linktrail)
   if "Category:" `T.isPrefixOf` pagename
      then do
        updateState $ \st -> st{ mwCategoryLinks = link : mwCategoryLinks st }
diff --git a/src/Text/Pandoc/Readers/ODT.hs b/src/Text/Pandoc/Readers/ODT.hs
--- a/src/Text/Pandoc/Readers/ODT.hs
+++ b/src/Text/Pandoc/Readers/ODT.hs
@@ -15,7 +15,9 @@
 
 import Codec.Archive.Zip
 import Text.Pandoc.XML.Light
+import Text.Pandoc.Walk
 
+import Data.Char (isDigit)
 import qualified Data.ByteString.Lazy as B
 
 import System.FilePath
@@ -46,8 +48,23 @@
 readODT opts bytes = case readODT' opts bytes of
   Right (doc, mb) -> do
     P.setMediaBag mb
-    return doc
+    return $ walk makeFigure doc
   Left e -> throwError e
+
+-- the ODT parser uses old-style figures: an image with title beginning
+-- "fig:" in a paragraph by itself.  Convert these to new Figure elements.
+makeFigure :: Block -> Block
+makeFigure (Para [ Image (ident, classes, kvs) capt (src, tit) ])
+  | "fig:" `T.isPrefixOf` tit
+  = Figure (ident, [], []) (Caption Nothing [Plain capt'])
+      [Plain [Image ("", classes, kvs) capt (src, "")]]
+   where
+     capt' = case capt of -- strip "Figure 1:" for consistency
+                 (Str _ : Space : Str t : Space : xs)
+                    | T.all (\c -> isDigit c || c == ':') t
+                    , ":" `T.isSuffixOf` t -> xs
+                 xs -> xs
+makeFigure x = x
 
 --
 readODT' :: ReaderOptions
diff --git a/src/Text/Pandoc/Readers/ODT/ContentReader.hs b/src/Text/Pandoc/Readers/ODT/ContentReader.hs
--- a/src/Text/Pandoc/Readers/ODT/ContentReader.hs
+++ b/src/Text/Pandoc/Readers/ODT/ContentReader.hs
@@ -393,39 +393,24 @@
 
 -- | Returns either 'id' or 'blockQuote' depending if any of the StyleProperties
 -- are indented at quote level.
-getParaModifier :: [StyleProperties] -> ParaModifier
-getParaModifier props | any isBlockQuote props
-                       = blockQuote
-                       | otherwise
-                       = id
+getParaModifier :: ListLevel -> [StyleProperties] -> ParaModifier
+getParaModifier listLevel props
+  | listLevel > 0 = id -- see #9505, list paragraphs need indentation
+  | any isBlockQuote props = blockQuote
+  | otherwise = id
   where
   isBlockQuote SProps {..} | Just paraProps <- paraProperties
-                                    , isQuoteWidth (indentation paraProps)
-                                                  (margin_left paraProps)
+                                    , isQuoteWidth (margin_left paraProps)
                                     = True
                                     | otherwise
                                     = False
-  isQuoteWidth mIndent mMargin
-    | LengthValueMM indent <- mIndent
-    ,  indent          > _MINIMUM_INDENTATION_FOR_BLOCKQUOTES_IN_MM_
-     = True
+  isQuoteWidth mMargin
     | LengthValueMM margin <- mMargin
     ,           margin > _MINIMUM_INDENTATION_FOR_BLOCKQUOTES_IN_MM_
      = True
-    | LengthValueMM indent <- mIndent
-    , LengthValueMM margin <- mMargin
-     = indent + margin > _MINIMUM_INDENTATION_FOR_BLOCKQUOTES_IN_MM_
-
-    | PercentValue  indent <- mIndent
-    ,  indent          > _MINIMUM_INDENTATION_FOR_BLOCKQUOTES_IN_PERCENT_
-     = True
     | PercentValue  margin <- mMargin
     ,           margin > _MINIMUM_INDENTATION_FOR_BLOCKQUOTES_IN_PERCENT_
      = True
-    | PercentValue  indent <- mIndent
-    , PercentValue  margin <- mMargin
-     = indent + margin > _MINIMUM_INDENTATION_FOR_BLOCKQUOTES_IN_PERCENT_
-
     | otherwise
      = False
 
@@ -440,7 +425,8 @@
       arr tableCaptionP  -< blocks'
     Right (_, style) -> do
       props <- fromStyles extendedStylePropertyChain -< [style]
-      let modifier = getParaModifier props
+      listLevel <- getCurrentListLevel -< ()
+      let modifier = getParaModifier listLevel props
       blocks' <- reader   -<  blocks
       arr modifier        -<< blocks'
   where
diff --git a/src/Text/Pandoc/Readers/Pod.hs b/src/Text/Pandoc/Readers/Pod.hs
--- a/src/Text/Pandoc/Readers/Pod.hs
+++ b/src/Text/Pandoc/Readers/Pod.hs
@@ -112,6 +112,7 @@
 encoding = do
   cmd "encoding"
   anyLine
+  optional blanklines
   logMessage $ IgnoredElement "=encoding; Pandoc requires UTF-8 input"
   return mempty
 
diff --git a/src/Text/Pandoc/Readers/TWiki.hs b/src/Text/Pandoc/Readers/TWiki.hs
--- a/src/Text/Pandoc/Readers/TWiki.hs
+++ b/src/Text/Pandoc/Readers/TWiki.hs
@@ -469,25 +469,25 @@
   st <- getState
   guard $ stateAllowLinks st
   setState $ st{ stateAllowLinks = False }
-  (url, title, content) <- linkText <|> simpleWikiLink
+  (url, title, classes, content) <- linkText <|> simpleWikiLink
   setState $ st{ stateAllowLinks = True }
-  return $ B.link url title content
+  return $ B.linkWith ("",classes,[]) url title content
 
-linkText :: PandocMonad m => TWParser m (Text, Text, B.Inlines)
+linkText :: PandocMonad m => TWParser m (Text, Text, [Text], B.Inlines)
 linkText = do
   string "[["
   url <- T.pack <$> many1Till anyChar (char ']')
   content <- option (B.str url) (mconcat <$> linkContent)
   char ']'
-  return (url, "", content)
+  return (url, "", [], content)
   where
     linkContent      = char '[' >> many1Till anyChar (char ']') >>= parseLinkContent . T.pack
     parseLinkContent = parseFromString' $ many1 inline
 
-simpleWikiLink :: PandocMonad m => TWParser m (Text, Text, B.Inlines)
+simpleWikiLink :: PandocMonad m => TWParser m (Text, Text, [Text], B.Inlines)
 simpleWikiLink = do
   w <- wikiWord
-  return (w, "wikilink", B.str w)
+  return (w, "", ["wikilink"], B.str w)
  where
    wikiWord = do
      cs <- many1 $ satisfy (\x -> isLetter x && isUpper x)
diff --git a/src/Text/Pandoc/Readers/Vimwiki.hs b/src/Text/Pandoc/Readers/Vimwiki.hs
--- a/src/Text/Pandoc/Readers/Vimwiki.hs
+++ b/src/Text/Pandoc/Readers/Vimwiki.hs
@@ -56,15 +56,7 @@
 import qualified Data.Text as T
 import Safe (lastMay)
 import Text.Pandoc.Builder (Blocks, Inlines, fromList, toList, trimInlines)
-import qualified Text.Pandoc.Builder as B (blockQuote, bulletList, code,
-                                           codeBlockWith, definitionList,
-                                           displayMath, divWith, emph,
-                                           headerWith, horizontalRule, image,
-                                           imageWith, link, math, orderedList,
-                                           para, plain, setMeta, simpleTable,
-                                           softbreak, space, spanWith, str,
-                                           strikeout, strong, subscript,
-                                           superscript)
+import qualified Text.Pandoc.Builder as B
 import Text.Pandoc.Class.PandocMonad (PandocMonad (..))
 import Text.Pandoc.Definition (Attr, Block (BulletList, OrderedList),
                                Inline (Space), ListNumberDelim (..),
@@ -555,17 +547,14 @@
                   then do
                     url <- manyTillChar anyChar $ char '|'
                     lab <- mconcat <$> manyTill inline (string "]]")
-                    let tit = if isURI url
-                                 then ""
-                                 else "wikilink"
-                    return $ B.link (procLink url) tit lab
+                    return $ B.linkWith (attr url) (procLink url) "" lab
                   else do
                     manyTill anyChar (string "]]")
 -- not using try here because [[hell]o]] is not rendered as a link in vimwiki
-                    let tit = if isURI contents
-                                 then ""
-                                 else "wikilink"
-                    return $ B.link (procLink contents) tit (B.str contents)
+                    return $ B.linkWith (attr contents) (procLink contents) "" (B.str contents)
+  where
+    attr t | isURI t = B.nullAttr
+           | otherwise = (mempty, ["wikilink"], mempty)
 
 image :: PandocMonad m => VwParser m Inlines
 image = try $ do
diff --git a/src/Text/Pandoc/RoffChar.hs b/src/Text/Pandoc/RoffChar.hs
--- a/src/Text/Pandoc/RoffChar.hs
+++ b/src/Text/Pandoc/RoffChar.hs
@@ -34,7 +34,6 @@
   , ('`', "\\[ga]")
   , ('^', "\\[ha]")
   , ('~', "\\[ti]")
-  , ('-', "\\-")
   , ('\\', "\\[rs]")
   , ('@', "\\[at]") -- because we use @ as a table and math delimiter
   , ('\x2026', "\\&...")  -- because u2026 doesn't render on tty
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -679,7 +679,7 @@
 -- | Set of HTML elements that are represented as Span with a class equal as
 -- the element tag itself.
 htmlSpanLikeElements :: Set.Set T.Text
-htmlSpanLikeElements = Set.fromList ["kbd", "mark", "dfn"]
+htmlSpanLikeElements = Set.fromList ["kbd", "mark", "dfn", "abbr"]
 
 -- | Reformat 'Inlines' as code, putting the stringlike parts in 'Code'
 -- elements while bringing other inline formatting outside.
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -239,20 +239,17 @@
                                  (\q -> qName q == "id" && qPrefix q == Just "r")
                                  idMap
                                  (elChildren sectpr')
-                        in Just . ppElement $
-                             add_attrs (elAttribs sectpr') $ mknode "w:sectPr" [] cs
-        Nothing      -> Nothing
-
+                        in add_attrs (elAttribs sectpr') $ mknode "w:sectPr" [] cs
+        Nothing      -> mknode "w:sectPr" []
+                          [ mknode "w:footnotePr" []
+                            [ mknode "w:numRestart" [("w:val","eachSect")] () ]
+                          ]
 
   ((contents, footnotes, comments), st) <- runStateT
                          (runReaderT
-                          (writeOpenXML opts{ writerWrapText = WrapNone
-                                            , writerVariables =
-                                                (maybe id (setField "sectpr") sectpr)
-                                                (writerVariables opts)
-                                                }
+                          (writeOpenXML opts{ writerWrapText = WrapNone }
                                         doc')
-                          env)
+                          env{ envSectPr = Just sectpr })
                          initialSt
   let epochtime = floor $ utcTimeToPOSIXSeconds utctime
   let imgs = M.elems $ stImages st
diff --git a/src/Text/Pandoc/Writers/Docx/OpenXML.hs b/src/Text/Pandoc/Writers/Docx/OpenXML.hs
--- a/src/Text/Pandoc/Writers/Docx/OpenXML.hs
+++ b/src/Text/Pandoc/Writers/Docx/OpenXML.hs
@@ -288,6 +288,8 @@
                  meta
   cStyleMap <- gets (smParaStyle . stStyleMaps)
   let styleIdOf name = fromStyleId $ getStyleIdFromName name cStyleMap
+  renderedSectPr <- maybe mempty ppElement <$> asks envSectPr
+
   let context = resetField "body" body
               . resetField "toc"
                    (vcat (map (literal . showElement) toc))
@@ -307,6 +309,7 @@
               . resetField "date-style-id" (styleIdOf "Date")
               . resetField "abstract-title-style-id" (styleIdOf "AbstractTitle")
               . resetField "abstract-style-id" (styleIdOf "Abstract")
+              . resetField "sectpr" renderedSectPr
               $ metadata
   tpl <- maybe (lift $ compileDefaultTemplate "openxml") pure $ writerTemplate opts
   let rendered = render Nothing $ renderTemplate tpl context
@@ -375,7 +378,10 @@
   wrapBookmark ident $ header <> contents
 blockToOpenXML' opts (Header lev (ident,_,kvs) lst) = do
   setFirstPara
-  let isChapter = lev == 1 && writerTopLevelDivision opts == TopLevelChapter
+  let isSection = case writerTopLevelDivision opts of
+                     TopLevelChapter -> lev == 1
+                     TopLevelPart -> lev <= 2
+                     _ -> False
   paraProps <- withParaPropM (pStyleM (fromString $ "Heading "++show lev)) $
                     getParaProps False
   number <-
@@ -389,10 +395,12 @@
                 Nothing -> return []
            else return []
   contents <- (number ++) <$> inlinesToOpenXML opts lst
+  sectpr <- asks envSectPr
   let addSectionBreak
-       | isChapter = (Elem (mknode "w:p" []
-                            (mknode "w:pPr" []
-                             [mknode "w:sectPr" [] ()])) :)
+       | isSection
+       , Just sectPrElem <- sectpr
+        = (Elem (mknode "w:p" []
+                   (mknode "w:pPr" [] [sectPrElem])) :)
        | otherwise = id
   addSectionBreak <$>
     if T.null ident
diff --git a/src/Text/Pandoc/Writers/Docx/Types.hs b/src/Text/Pandoc/Writers/Docx/Types.hs
--- a/src/Text/Pandoc/Writers/Docx/Types.hs
+++ b/src/Text/Pandoc/Writers/Docx/Types.hs
@@ -89,6 +89,7 @@
   , envChangesDate    :: Text
   , envPrintWidth     :: Integer
   , envLang           :: Maybe Text
+  , envSectPr         :: Maybe Element
   }
 
 defaultWriterEnv :: WriterEnv
@@ -104,6 +105,7 @@
   , envChangesDate    = "1969-12-31T19:00:00Z"
   , envPrintWidth     = 1
   , envLang           = Nothing
+  , envSectPr         = Nothing
   }
 
 
diff --git a/src/Text/Pandoc/Writers/JATS.hs b/src/Text/Pandoc/Writers/JATS.hs
--- a/src/Text/Pandoc/Writers/JATS.hs
+++ b/src/Text/Pandoc/Writers/JATS.hs
@@ -27,7 +27,7 @@
 import Control.Monad.State
 import Data.Generics (everywhere, mkT)
 import qualified Data.Map as M
-import Data.Maybe (fromMaybe, listToMaybe)
+import Data.Maybe (fromMaybe, listToMaybe, isNothing)
 import Data.Time (toGregorian, Day, parseTimeM, defaultTimeLocale, formatTime)
 import qualified Data.Text as T
 import Data.Text (Text)
@@ -43,7 +43,7 @@
 import Text.Pandoc.Shared
 import Text.Pandoc.URI
 import Text.Pandoc.Templates (renderTemplate)
-import Text.DocTemplates (Context(..), Val(..))
+import Text.DocTemplates (Context(..), Val(..), toVal)
 import Text.Pandoc.Writers.JATS.References (referencesToJATS)
 import Text.Pandoc.Writers.JATS.Table (tableToJATS)
 import Text.Pandoc.Writers.JATS.Types
@@ -54,6 +54,54 @@
 import qualified Text.Pandoc.Writers.AnnotatedTable as Ann
 import qualified Text.XML.Light as Xml
 
+-- | Default human-readable names for roles in the Contributor Role
+-- Taxonomy (CRediT). This is useful for generating JATS that annotate
+-- contributor roles
+creditNames :: M.Map Text Text
+creditNames = M.fromList [
+    ("conceptualization", "Conceptualization"),
+    ("data-curation", "Data curation"),
+    ("formal-analysis", "Formal analysis"),
+    ("funding-acquisition", "Funding acquisition"),
+    ("investigation", "Investigation"),
+    ("methodology", "Methodology"),
+    ("project-administration", "Project administration"),
+    ("resources", "Resources"),
+    ("software", "Software"),
+    ("supervision", "Supervision"),
+    ("validation", "Validation"),
+    ("visualization", "Visualization"),
+    ("writing-original-draft", "Writing – original draft"),
+    ("writing-review-editing", "Writing – review & editing")]
+
+-- | Ensure every role with a `credit` key also has a `credit-name`,
+-- using a default value if necessary
+addCreditNames :: Context Text -> Context Text
+addCreditNames context =
+  case getField "author" context of
+    -- If there is an "authors" key, then we replace the existing value
+    -- with one we mutate by running the addCreditNamesToAuthor helper
+    -- function on each
+    Just (ListVal authors) ->
+      resetField "author" (map addCreditNamesToAuthor authors) context
+    -- If there is no "authors" key in the context, then we don't have to do
+    -- anything, and just return the context as is
+    _ -> context
+  where
+    addCreditNamesToAuthor :: Val Text -> Val Text
+    addCreditNamesToAuthor val = fromMaybe val $ do
+      MapVal authorCtx <- pure val
+      ListVal roles <- getField "roles" authorCtx
+      return $ toVal $ resetField "roles" (map addCreditNameToRole roles) authorCtx
+
+    addCreditNameToRole :: Val Text -> Val Text
+    addCreditNameToRole val = fromMaybe val $ do
+      MapVal roleCtx <- pure val
+      guard $ isNothing (getField "credit-name" roleCtx :: Maybe (Val Text))
+      creditId <- getField "credit" roleCtx
+      creditName <- M.lookup creditId creditNames
+      return $ toVal $ resetField "credit-name" creditName roleCtx
+
 -- | Convert a @'Pandoc'@ document to JATS (Archiving and Interchange
 -- Tag Set.)
 writeJatsArchiving :: PandocMonad m => WriterOptions -> Pandoc -> m Text
@@ -159,6 +207,7 @@
                (lookupMetaInlines "title" meta)
   let context = defField "body" main
               $ defField "back" back
+              $ addCreditNames
               $ resetField "title" title'
               $ resetField "date" date
               $ defField "mathml" (case writerHTMLMathMethod opts of
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -265,9 +265,15 @@
                       (literal $ renderLang l)) mblang
         $ maybe id (\l -> defField "babel-lang"
                       (literal l)) babelLang
+        $ (case babelLang of -- see #8283
+                Just l | l `notElem` ldfLanguages
+                         -> defField "babeloptions" ("provide=*" :: Text)
+                _ -> id)
         $ defField "babel-otherlangs"
              (map literal
-               (nubOrd . catMaybes . filter (/= babelLang)
+               (filter (`elem` ldfLanguages) .
+                nubOrd . catMaybes .
+                filter (/= babelLang)
                 $ map toBabel docLangs))
         $ defField "selnolig-langs"
              (literal . T.intercalate "," $
@@ -1187,3 +1193,96 @@
   result <- pa
   modify $ \st -> st{ stInSoulCommand = oldInSoulCommand }
   pure result
+
+-- Babel languages with a .ldf that works well with all engines (see #8283).
+-- We follow the guidance from the Babel documentation:
+-- "In general, you should do this for European languages written in Latin
+-- and Cyrillic scripts, as well as for Vietnamese."
+ldfLanguages :: [Text]
+ldfLanguages =
+  [ "magyar"
+  , "croatian"
+  , "ngerman"
+  , "germanb"
+  , "german"
+  , "austrian"
+  , "ngermanb"
+  , "naustrian"
+  , "nswissgerman"
+  , "swissgerman"
+  , "italian"
+  , "greek"
+  , "azerbaijani"
+  , "american"
+  , "newzealand"
+  , "UKenglish"
+  , "USenglish"
+  , "australian"
+  , "british"
+  , "canadian"
+  , "english"
+  , "bahasa"
+  , "slovak"
+  , "finnish"
+  , "occitan"
+  , "swedish"
+  , "brazil"
+  , "portuguese"
+  , "portuges"
+  , "brazilian"
+  , "spanish"
+  , "norwegian"
+  , "norsk"
+  , "nynorsk"
+  , "bulgarian"
+  , "breton"
+  , "belarusian"
+  , "piedmontese"
+  , "esperanto"
+  , "lithuanian"
+  , "ukraineb"
+  , "scottishgaelic"
+  , "scottish"
+  , "dutch"
+  , "afrikaans"
+  , "czech"
+  , "serbian"
+  , "latvian"
+  , "catalan"
+  , "basque"
+  , "albanian"
+  , "irish"
+  , "serbianc"
+  , "interlingua"
+  , "bosnian"
+  , "friulan"
+  , "romanian"
+  , "icelandic"
+  , "classiclatin"
+  , "ecclesiasticlatin"
+  , "medievallatin"
+  , "latin"
+  , "georgian"
+  , "macedonian"
+  , "welsh"
+  , "vietnamese"
+  , "romansh"
+  , "danish"
+  , "lsorbian"
+  , "usorbian"
+  , "polish-compat"
+  , "polish"
+  , "estonian"
+  , "french"
+  , "frenchb"
+  , "canadien"
+  , "acadian"
+  , "francais"
+  , "turkish"
+  , "hindi"
+  , "northernsami"
+  , "samin"
+  , "russianb"
+  , "galician"
+  , "slovene"
+  ]
diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs
--- a/src/Text/Pandoc/Writers/Man.hs
+++ b/src/Text/Pandoc/Writers/Man.hs
@@ -86,9 +86,9 @@
        Just tpl -> renderTemplate tpl context
 
 escString :: WriterOptions -> Text -> Text
-escString opts = escapeString (if writerPreferAscii opts
-                                  then AsciiOnly
-                                  else AllowUTF8)
+escString opts = escapeString True (if writerPreferAscii opts
+                                       then AsciiOnly
+                                       else AllowUTF8)
 
 -- | Return man representation of notes.
 notesToMan :: PandocMonad m => WriterOptions -> [[Block]] -> StateT WriterState m (Doc Text)
diff --git a/src/Text/Pandoc/Writers/Markdown/Inline.hs b/src/Text/Pandoc/Writers/Markdown/Inline.hs
--- a/src/Text/Pandoc/Writers/Markdown/Inline.hs
+++ b/src/Text/Pandoc/Writers/Markdown/Inline.hs
@@ -649,7 +649,7 @@
                 case txt of
                       [Str s] | escapeURI s == srcSuffix -> True
                       _       -> False
-  let useWikilink = tit == "wikilink" &&
+  let useWikilink = "wikilink" `elem` classes &&
                     (isEnabled Ext_wikilinks_title_after_pipe opts ||
                      isEnabled Ext_wikilinks_title_before_pipe opts)
   let useRefLinks = writerReferenceLinks opts && not useAuto
diff --git a/src/Text/Pandoc/Writers/Ms.hs b/src/Text/Pandoc/Writers/Ms.hs
--- a/src/Text/Pandoc/Writers/Ms.hs
+++ b/src/Text/Pandoc/Writers/Ms.hs
@@ -92,7 +92,7 @@
 
 escapeStr :: WriterOptions -> Text -> Text
 escapeStr opts =
-  escapeString (if writerPreferAscii opts then AsciiOnly else AllowUTF8)
+  escapeString False (if writerPreferAscii opts then AsciiOnly else AllowUTF8)
 
 -- In PDFs we need to escape parentheses and backslash.
 -- In PDF we need to encode as UTF-16 BE.
diff --git a/src/Text/Pandoc/Writers/Roff.hs b/src/Text/Pandoc/Writers/Roff.hs
--- a/src/Text/Pandoc/Writers/Roff.hs
+++ b/src/Text/Pandoc/Writers/Roff.hs
@@ -74,13 +74,18 @@
 essentialEscapes :: Map.Map Char Text
 essentialEscapes = Map.fromList standardEscapes
 
--- | Escape special characters for roff.
-escapeString :: EscapeMode -> Text -> Text
-escapeString e = Text.concat . escapeString' e . Text.unpack
+-- | Escape special characters for roff. If the first parameter is
+-- True, escape @-@ as @\-@, as required by current versions of groff man;
+-- otherwise leave it unescaped, as neededfor ms.
+escapeString :: Bool -> EscapeMode -> Text -> Text
+escapeString escapeHyphen e = Text.concat . escapeString' e . Text.unpack
   where
     escapeString' _ [] = []
     escapeString' escapeMode ('\n':'.':xs) =
       "\n\\&." : escapeString' escapeMode xs
+    -- see #10533; we need to escape hyphens as \- in man but not in ms:
+    escapeString' escapeMode ('-':xs) | escapeHyphen =
+      "\\-" : escapeString' escapeMode xs
     escapeString' escapeMode (x:xs) =
       case Map.lookup x essentialEscapes of
         Just s  -> s : escapeString' escapeMode xs
diff --git a/src/Text/Pandoc/Writers/Typst.hs b/src/Text/Pandoc/Writers/Typst.hs
--- a/src/Text/Pandoc/Writers/Typst.hs
+++ b/src/Text/Pandoc/Writers/Typst.hs
@@ -131,8 +131,16 @@
 
 toTypstSetText :: [(Text, Text)] -> Doc Text
 toTypstSetText [] = ""
-toTypstSetText typstTextAttrs = "#set text" <> parens (toTypstPropsListSep typstTextAttrs) <> "; " -- newline?
+toTypstSetText typstTextAttrs = "set text" <> parens (toTypstPropsListSep typstTextAttrs) <> "; "
 
+toTypstPoundSetText :: [(Text, Text)] -> Doc Text
+toTypstPoundSetText [] = ""
+toTypstPoundSetText typstTextAttrs = "#" <> toTypstSetText typstTextAttrs
+
+toTypstBracesSetText :: [(Text, Text)] -> Doc Text -> Doc Text
+toTypstBracesSetText [] x = "#" <> x
+toTypstBracesSetText typstTextAttrs x = "#" <> braces (toTypstSetText typstTextAttrs <> x)
+
 blocksToTypst :: PandocMonad m => [Block] -> TW m (Doc Text)
 blocksToTypst blocks = vcat <$> mapM blockToTypst blocks
 
@@ -259,7 +267,7 @@
                      ColSpan n -> [ "colspan: " <> tshow n ]) ++
                   map formatTypstProp typstAttrs2
             cellContents <- blocksToTypst bs
-            let contents2 = brackets (toTypstSetText typstTextAttrs <> cellContents)
+            let contents2 = brackets (toTypstPoundSetText typstTextAttrs <> cellContents)
             pure $ if null cellattrs
                       then contents2
                       else "table.cell" <>
@@ -288,7 +296,7 @@
       header <- fromHead thead
       footer <- fromFoot tfoot
       body <- vcat <$> mapM fromTableBody tbodies
-      let table = toTypstSetText typstTextAttrs <> "#table("
+      let table = "table("
             $$ nest 2
                 (  "columns: " <> columns <> ","
                 $$ "align: " <> alignarray <> ","
@@ -299,11 +307,11 @@
             )
             $$ ")"
       return $ if "typst:no-figure" `elem` tabclasses
-        then table
+        then toTypstBracesSetText typstTextAttrs table
         else "#figure("
             $$
             nest 2
-            ("align(center)[" <> table <> "]"
+            ("align(center)[" <> toTypstPoundSetText typstTextAttrs <> "#" <> table <> "]"
               $$ capt'
               $$ typstFigureKind
               $$ ")")
@@ -332,7 +340,7 @@
       let (typstAttrs,typstTextAttrs) = pickTypstAttrs kvs
       contents <- blocksToTypst blocks
       return $ "#block" <> toTypstPropsListParens typstAttrs <> "["
-        $$ toTypstSetText typstTextAttrs <> contents
+        $$ toTypstPoundSetText typstTextAttrs <> contents
         $$ ("]" <+> lab)
 
 defListItemToTypst :: PandocMonad m => ([Inline], [[Block]]) -> TW m (Doc Text)
diff --git a/test/Tests/MediaBag.hs b/test/Tests/MediaBag.hs
--- a/test/Tests/MediaBag.hs
+++ b/test/Tests/MediaBag.hs
@@ -29,7 +29,7 @@
         assertBool "file in directory is not extracted with original name" exists1
         exists2 <- doesFileExist ("foo" </> "f9d88c3dbe18f6a7f5670e994a947d51216cdf0e.jpg")
         assertBool "file above directory is not extracted with hashed name" exists2
-        exists3 <- doesFileExist ("foo" </> "2a0eaa89f43fada3e6c577beea4f2f8f53ab6a1d.lua")
+        exists3 <- doesFileExist ("foo" </> "2a0eaa89f43fada3e6c577beea4f2f8f53ab6a1d.png")
         exists4 <- doesFileExist "a.lua"
         assertBool "data uri with malicious payload gets written outside of destination dir"
           (exists3 && not exists4)
diff --git a/test/Tests/Readers/Docx.hs b/test/Tests/Readers/Docx.hs
--- a/test/Tests/Readers/Docx.hs
+++ b/test/Tests/Readers/Docx.hs
@@ -487,6 +487,11 @@
             "comment warnings (all)"
             "docx/comments_warning.docx"
             ["Docx comment 1 will not retain formatting"]
+          , testForWarningsWithOpts def{readerTrackChanges=AllChanges,
+                                        readerExtensions=extensionsFromList [Ext_styles]}
+            "comments (with styles extension)"
+            "docx/comments.docx"
+            []
           ]
         , testGroup "media"
           [ testMediaBag
diff --git a/test/Tests/Readers/Markdown.hs b/test/Tests/Readers/Markdown.hs
--- a/test/Tests/Readers/Markdown.hs
+++ b/test/Tests/Readers/Markdown.hs
@@ -58,6 +58,9 @@
 autolinkWith attr s = linkWith attr s' "" (str s')
   where s' = T.pack s
 
+wikilink :: Attr
+wikilink = (mempty, ["wikilink"], mempty)
+
 bareLinkTests :: [(Text, Inlines)]
 bareLinkTests =
   [ ("http://google.com is a search engine.",
@@ -312,22 +315,22 @@
         , testGroup "Github wiki links"
           [ test markdownGH "autolink" $
             "[[https://example.org]]" =?>
-            para (link "https://example.org" "wikilink" (str "https://example.org"))
+            para (linkWith wikilink "https://example.org" "" (str "https://example.org"))
           , test markdownGH "link with title" $
             "[[title|https://example.org]]" =?>
-            para (link "https://example.org" "wikilink" (str "title"))
+            para (linkWith wikilink "https://example.org" "" (str "title"))
           , test markdownGH "bad link with title" $
             "[[title|random string]]" =?>
-            para (link "random string" "wikilink" (str "title"))
+            para (linkWith wikilink "random string" "" (str "title"))
           , test markdownGH "autolink not being a link" $
             "[[Name of page]]" =?>
-            para (link "Name of page" "wikilink" (text "Name of page"))
+            para (linkWith wikilink "Name of page" "" (text "Name of page"))
           , test markdownGH "autolink not being a link with a square bracket" $
             "[[Name of ]page]]" =?>
-            para (link "Name of ]page" "wikilink" (text "Name of ]page"))
+            para (linkWith wikilink "Name of ]page" "" (text "Name of ]page"))
           , test markdownGH "link with inline start should be a link" $
             "[[t`i*t_le|https://example.org]]" =?>
-            para (link "https://example.org" "wikilink" (str "t`i*t_le"))
+            para (linkWith wikilink "https://example.org" "" (str "t`i*t_le"))
           ]
         , testGroup "Headers"
           [ "blank line before header" =:
diff --git a/test/command/10152.md b/test/command/10152.md
new file mode 100644
--- /dev/null
+++ b/test/command/10152.md
@@ -0,0 +1,446 @@
+# CRediT Roles
+
+This document contains tests and examples for enabling
+export of roles to JATS. It was added for
+[Issue #10152](https://github.com/jgm/pandoc/issues/10152)
+and corresponding [Pull Request #10153](https://github.com/jgm/pandoc/pull/10153).
+
+In the first example, we show a fully qualified CRediT role.
+An explicit name isn't given, so the CRediT name is used.
+
+```
+% pandoc -s -t jats
+---
+title: CRediT Test
+author:
+  - name: Max Mustermann
+    affiliation: [ 1 ]
+    roles:
+      - credit: software
+        credit-name: Software
+        degree: Lead
+affiliation:
+- id: 1
+  name: Silverlight University
+---
+^D
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN"
+                  "JATS-archivearticle1.dtd">
+<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="1.2" article-type="other">
+<front>
+<journal-meta>
+<journal-id></journal-id>
+<journal-title-group>
+</journal-title-group>
+<issn></issn>
+<publisher>
+<publisher-name></publisher-name>
+</publisher>
+</journal-meta>
+<article-meta>
+<title-group>
+<article-title>CRediT Test</article-title>
+</title-group>
+<contrib-group>
+<contrib contrib-type="author">
+<string-name>Max Mustermann</string-name>
+<role vocab="credit" degree-contribution="Lead"
+      vocab-identifier="https://credit.niso.org/"
+      vocab-term-identifier="https://credit.niso.org/contributor-roles/software/"
+      vocab-term="Software"
+>Software</role>
+<xref ref-type="aff" rid="aff-1"/>
+</contrib>
+<aff id="aff-1">
+<institution-wrap>
+<institution>Silverlight University</institution>
+</institution-wrap>
+</aff>
+</contrib-group>
+<permissions>
+</permissions>
+</article-meta>
+</front>
+<body>
+
+</body>
+<back>
+</back>
+</article>
+```
+
+In the second example, we show a fully qualified CRediT role.
+An explicit name is given in a different language.
+
+```
+% pandoc -s -t jats
+---
+title: CRediT Test
+author:
+  - name: Max Mustermann
+    affiliation: [ 1 ]
+    roles:
+      - credit: software
+        credit-name: Software
+        degree: Lead
+        name: Programas
+affiliation:
+- id: 1
+  name: Silverlight University
+---
+^D
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN"
+                  "JATS-archivearticle1.dtd">
+<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="1.2" article-type="other">
+<front>
+<journal-meta>
+<journal-id></journal-id>
+<journal-title-group>
+</journal-title-group>
+<issn></issn>
+<publisher>
+<publisher-name></publisher-name>
+</publisher>
+</journal-meta>
+<article-meta>
+<title-group>
+<article-title>CRediT Test</article-title>
+</title-group>
+<contrib-group>
+<contrib contrib-type="author">
+<string-name>Max Mustermann</string-name>
+<role vocab="credit" degree-contribution="Lead"
+      vocab-identifier="https://credit.niso.org/"
+      vocab-term-identifier="https://credit.niso.org/contributor-roles/software/"
+      vocab-term="Software"
+>Programas</role>
+<xref ref-type="aff" rid="aff-1"/>
+</contrib>
+<aff id="aff-1">
+<institution-wrap>
+<institution>Silverlight University</institution>
+</institution-wrap>
+</aff>
+</contrib-group>
+<permissions>
+</permissions>
+</article-meta>
+</front>
+<body>
+
+</body>
+<back>
+</back>
+</article>
+```
+
+In this example, we show a partially qualified CRediT role
+that does not have a `degree`:
+
+```
+% pandoc -s -t jats
+---
+title: CRediT Test
+author:
+  - name: Max Mustermann
+    affiliation: [ 1 ]
+    roles:
+      - credit: software
+        credit-name: Software
+affiliation:
+- id: 1
+  name: Silverlight University
+---
+^D
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN"
+                  "JATS-archivearticle1.dtd">
+<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="1.2" article-type="other">
+<front>
+<journal-meta>
+<journal-id></journal-id>
+<journal-title-group>
+</journal-title-group>
+<issn></issn>
+<publisher>
+<publisher-name></publisher-name>
+</publisher>
+</journal-meta>
+<article-meta>
+<title-group>
+<article-title>CRediT Test</article-title>
+</title-group>
+<contrib-group>
+<contrib contrib-type="author">
+<string-name>Max Mustermann</string-name>
+<role vocab="credit"
+      vocab-identifier="https://credit.niso.org/"
+      vocab-term-identifier="https://credit.niso.org/contributor-roles/software/"
+      vocab-term="Software"
+>Software</role>
+<xref ref-type="aff" rid="aff-1"/>
+</contrib>
+<aff id="aff-1">
+<institution-wrap>
+<institution>Silverlight University</institution>
+</institution-wrap>
+</aff>
+</contrib-group>
+<permissions>
+</permissions>
+</article-meta>
+</front>
+<body>
+
+</body>
+<back>
+</back>
+</article>
+```
+
+In this example, we show a more stripped-down data that requires automatic lookup of the
+`credit-name`.
+
+```
+% pandoc -s -t jats
+---
+title: CRediT Test
+author:
+  - name: Max Mustermann
+    affiliation: [ 1 ]
+    roles:
+      - credit: software
+affiliation:
+- id: 1
+  name: Silverlight University
+---
+^D
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN"
+                  "JATS-archivearticle1.dtd">
+<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="1.2" article-type="other">
+<front>
+<journal-meta>
+<journal-id></journal-id>
+<journal-title-group>
+</journal-title-group>
+<issn></issn>
+<publisher>
+<publisher-name></publisher-name>
+</publisher>
+</journal-meta>
+<article-meta>
+<title-group>
+<article-title>CRediT Test</article-title>
+</title-group>
+<contrib-group>
+<contrib contrib-type="author">
+<string-name>Max Mustermann</string-name>
+<role vocab="credit"
+      vocab-identifier="https://credit.niso.org/"
+      vocab-term-identifier="https://credit.niso.org/contributor-roles/software/"
+      vocab-term="Software"
+>Software</role>
+<xref ref-type="aff" rid="aff-1"/>
+</contrib>
+<aff id="aff-1">
+<institution-wrap>
+<institution>Silverlight University</institution>
+</institution-wrap>
+</aff>
+</contrib-group>
+<permissions>
+</permissions>
+</article-meta>
+</front>
+<body>
+
+</body>
+<back>
+</back>
+</article>
+```
+
+In this example, we test the correct XML encoding of
+the CRediT role [Writing – review & editing](https://credit.niso.org/contributor-roles/writing-review-editing/),
+which annoyingly contains an ampersand in its label.
+
+```
+% pandoc -s -t jats
+---
+title: CRediT Test
+author:
+  - name: Max Mustermann
+    affiliation: [ 1 ]
+    roles:
+      - credit: writing-review-editing
+        credit-name: Writing – review & editing
+        degree: Lead
+affiliation:
+- id: 1
+  name: Silverlight University
+---
+^D
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN"
+                  "JATS-archivearticle1.dtd">
+<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="1.2" article-type="other">
+<front>
+<journal-meta>
+<journal-id></journal-id>
+<journal-title-group>
+</journal-title-group>
+<issn></issn>
+<publisher>
+<publisher-name></publisher-name>
+</publisher>
+</journal-meta>
+<article-meta>
+<title-group>
+<article-title>CRediT Test</article-title>
+</title-group>
+<contrib-group>
+<contrib contrib-type="author">
+<string-name>Max Mustermann</string-name>
+<role vocab="credit" degree-contribution="Lead"
+      vocab-identifier="https://credit.niso.org/"
+      vocab-term-identifier="https://credit.niso.org/contributor-roles/writing-review-editing/"
+      vocab-term="Writing – review &amp; editing"
+>Writing – review &amp; editing</role>
+<xref ref-type="aff" rid="aff-1"/>
+</contrib>
+<aff id="aff-1">
+<institution-wrap>
+<institution>Silverlight University</institution>
+</institution-wrap>
+</aff>
+</contrib-group>
+<permissions>
+</permissions>
+</article-meta>
+</front>
+<body>
+
+</body>
+<back>
+</back>
+</article>
+```
+
+In this example, we show a role that isn't qualified with CRediT.
+
+```
+% pandoc -s -t jats
+---
+title: CRediT Test
+author:
+  - name: Max Mustermann
+    affiliation: [ 1 ]
+    roles:
+      - name: Dolphin Catcher
+affiliation:
+- id: 1
+  name: Silverlight University
+---
+^D
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN"
+                  "JATS-archivearticle1.dtd">
+<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="1.2" article-type="other">
+<front>
+<journal-meta>
+<journal-id></journal-id>
+<journal-title-group>
+</journal-title-group>
+<issn></issn>
+<publisher>
+<publisher-name></publisher-name>
+</publisher>
+</journal-meta>
+<article-meta>
+<title-group>
+<article-title>CRediT Test</article-title>
+</title-group>
+<contrib-group>
+<contrib contrib-type="author">
+<string-name>Max Mustermann</string-name>
+<role>Dolphin Catcher</role>
+<xref ref-type="aff" rid="aff-1"/>
+</contrib>
+<aff id="aff-1">
+<institution-wrap>
+<institution>Silverlight University</institution>
+</institution-wrap>
+</aff>
+</contrib-group>
+<permissions>
+</permissions>
+</article-meta>
+</front>
+<body>
+
+</body>
+<back>
+</back>
+</article>
+```
+
+In this example, we show a role that neither has a CRediT identifer,
+nor a name, so it's ignored.
+
+```
+% pandoc -s -t jats
+---
+title: CRediT Test
+author:
+  - name: Max Mustermann
+    affiliation: [ 1 ]
+    roles:
+      - irrelevant-key: Dolphin Catcher
+affiliation:
+- id: 1
+  name: Silverlight University
+---
+^D
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN"
+                  "JATS-archivearticle1.dtd">
+<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="1.2" article-type="other">
+<front>
+<journal-meta>
+<journal-id></journal-id>
+<journal-title-group>
+</journal-title-group>
+<issn></issn>
+<publisher>
+<publisher-name></publisher-name>
+</publisher>
+</journal-meta>
+<article-meta>
+<title-group>
+<article-title>CRediT Test</article-title>
+</title-group>
+<contrib-group>
+<contrib contrib-type="author">
+<string-name>Max Mustermann</string-name>
+<xref ref-type="aff" rid="aff-1"/>
+</contrib>
+<aff id="aff-1">
+<institution-wrap>
+<institution>Silverlight University</institution>
+</institution-wrap>
+</aff>
+</contrib-group>
+<permissions>
+</permissions>
+</article-meta>
+</front>
+<body>
+
+</body>
+<back>
+</back>
+</article>
+```
diff --git a/test/command/10537.md b/test/command/10537.md
new file mode 100644
--- /dev/null
+++ b/test/command/10537.md
@@ -0,0 +1,24 @@
+```
+% pandoc -f pod -t html
+=encoding utf8
+
+=head1 NAME
+
+Test document
+^D
+<h1>NAME</h1>
+<p>Test document</p>
+```
+
+```
+% pandoc -f pod -t html
+=encoding utf8
+
+
+=head1 NAME
+
+Test document
+^D
+<h1>NAME</h1>
+<p>Test document</p>
+```
diff --git a/test/command/10594.md b/test/command/10594.md
new file mode 100644
--- /dev/null
+++ b/test/command/10594.md
@@ -0,0 +1,28 @@
+```
+% pandoc -f docbook -t native
+<orderedlist numeration="loweralpha">
+<title>header inside listing</title>   // not rendered in any output format!
+<listitem>
+<simpara>first step</simpara>
+</listitem>
+</orderedlist>
+^D
+[ Div
+    ( "" , [] , [] )
+    [ Div
+        ( "" , [ "title" ] , [] )
+        [ Plain
+            [ Str "header"
+            , Space
+            , Str "inside"
+            , Space
+            , Str "listing"
+            ]
+        ]
+    , OrderedList
+        ( 1 , LowerAlpha , DefaultDelim )
+        [ [ Para [ Str "first" , Space , Str "step" ] ] ]
+    ]
+]
+
+```
diff --git a/test/command/2649.md b/test/command/2649.md
--- a/test/command/2649.md
+++ b/test/command/2649.md
@@ -90,19 +90,20 @@
 <tr>
 <td><p>1</p></td>
 <td style="text-align: left;"><p><a href="Sébastien_Loeb"
-title="wikilink">Sébastien Loeb</a></p></td>
+class="wikilink" title="Sébastien Loeb">Sébastien Loeb</a></p></td>
 <td><p>78</p></td>
 </tr>
 <tr>
 <td><p>2</p></td>
 <td style="text-align: left;"><p><strong><a href="Sébastien_Ogier"
-title="wikilink">Sébastien Ogier</a></strong></p></td>
+class="wikilink" title="Sébastien Ogier">Sébastien
+Ogier</a></strong></p></td>
 <td><p>38</p></td>
 </tr>
 <tr>
 <td><p>10</p></td>
 <td style="text-align: left;"><p><a href="Hannu_Mikkola"
-title="wikilink">Hannu Mikkola</a></p></td>
+class="wikilink" title="Hannu Mikkola">Hannu Mikkola</a></p></td>
 <td><p>18</p></td>
 </tr>
 </tbody>
diff --git a/test/command/4470.md b/test/command/4470.md
new file mode 100644
--- /dev/null
+++ b/test/command/4470.md
@@ -0,0 +1,27 @@
+```
+% pandoc -r latex -w plain
+\newcommand{\foo}{123}\renewcommand\foo{456}\foo
+^D
+456
+```
+
+```
+% pandoc -r latex -w plain
+\newcommand\foo{123}\renewcommand\foo{456}\foo
+^D
+456
+```
+
+```
+% pandoc -r latex -w plain
+\newcommand{\foo}{123}\renewcommand{\foo}{456}\foo
+^D
+456
+```
+
+```
+% pandoc -r latex -w plain
+\newcommand\foo{123}\renewcommand{\foo}{456}\foo
+^D
+456
+```
diff --git a/test/command/5793.md b/test/command/5793.md
new file mode 100644
--- /dev/null
+++ b/test/command/5793.md
@@ -0,0 +1,13 @@
+```
+% pandoc -f html -t djot
+You can use <abbr title="Cascading Style Sheets">CSS</abbr>
+^D
+You can use [CSS]{.abbr title="Cascading Style Sheets"}
+```
+
+```
+% pandoc -f djot -t html
+You can use [CSS]{.abbr title="Cascading Style Sheets"}
+^D
+<p>You can use <abbr title="Cascading Style Sheets">CSS</abbr></p>
+```
diff --git a/test/command/8666.md b/test/command/8666.md
new file mode 100644
--- /dev/null
+++ b/test/command/8666.md
@@ -0,0 +1,40 @@
+```
+% pandoc -f docbook -t native
+<formalpara xml:id="my_code_id">
+<title>Code title</title>
+<para>
+<programlisting language="bash" linenumbering="unnumbered">echo "hello world!"</programlisting>
+</para>
+</formalpara>
+<example xml:id="my_example_id">
+<title>Example title</title>
+<simpara>example content</simpara>
+</example>
+<sidebar xml:id="my_sidebar_id">
+<title>Sidebar title</title>
+<simpara>sidebar content</simpara>
+</sidebar>
+^D
+[ Div
+    ( "my_code_id" , [ "formalpara" ] , [] )
+    [ Div
+        ( "" , [ "title" ] , [] )
+        [ Plain [ Str "Code" , Space , Str "title" ] ]
+    , CodeBlock ( "" , [ "bash" ] , [] ) "echo \"hello world!\""
+    ]
+, Div
+    ( "my_example_id" , [ "example" ] , [] )
+    [ Div
+        ( "" , [ "title" ] , [] )
+        [ Plain [ Str "Example" , Space , Str "title" ] ]
+    , Para [ Str "example" , Space , Str "content" ]
+    ]
+, Div
+    ( "my_sidebar_id" , [ "sidebar" ] , [] )
+    [ Div
+        ( "" , [ "title" ] , [] )
+        [ Plain [ Str "Sidebar" , Space , Str "title" ] ]
+    , Para [ Str "sidebar" , Space , Str "content" ]
+    ]
+]
+```
diff --git a/test/command/8853.md b/test/command/8853.md
--- a/test/command/8853.md
+++ b/test/command/8853.md
@@ -2,5 +2,5 @@
 % pandoc -f markdown+wikilinks_title_after_pipe --wrap=none
 [[hi]] and ![[hi]]
 ^D
-<p><a href="hi" title="wikilink">hi</a> and <img src="hi" title="wikilink" alt="hi" /></p>
+<p><a href="hi" class="wikilink">hi</a> and <img src="hi" class="wikilink" alt="hi" /></p>
 ```
diff --git a/test/command/9472.md b/test/command/9472.md
--- a/test/command/9472.md
+++ b/test/command/9472.md
@@ -12,6 +12,8 @@
 \PassOptionsToPackage{unicode}{hyperref}
 \PassOptionsToPackage{hyphens}{url}
 \documentclass[
+  french,
+  ngerman,
 ]{article}
 \usepackage{xcolor}
 \usepackage{amsmath,amssymb}
@@ -51,8 +53,6 @@
 \else
 \usepackage[bidi=default]{babel}
 \fi
-\babelprovide[main,import]{ngerman}
-\babelprovide[import]{french}
 % get rid of language-specific shorthands (see #6817):
 \let\LanguageShortHands\languageshorthands
 \def\languageshorthands#1{}
diff --git a/test/command/author-in-text-move-note.md b/test/command/author-in-text-move-note.md
new file mode 100644
--- /dev/null
+++ b/test/command/author-in-text-move-note.md
@@ -0,0 +1,19 @@
+```
+% pandoc --citeproc --csl command/chicago-fullnote-bibliography.csl -t plain
+---
+references:
+- id: foo
+  type: book
+  author: John Doe
+  title: A Book
+...
+
+See @foo [p. 21], as well.
+^D
+See John Doe,[1] as well.
+
+John Doe. A Book, n.d.
+
+[1] A Book, n.d., 21.
+```
+
diff --git a/test/command/typst-property-output.md b/test/command/typst-property-output.md
--- a/test/command/typst-property-output.md
+++ b/test/command/typst-property-output.md
@@ -152,3 +152,81 @@
   , kind: table
   )
 ```
+
+```
+% pandoc -f html -t typst
+<p>Paragraph before.</p>
+
+<table class="typst:no-figure" typst:text:size="3em">
+  <tr>
+    <td>A</td>
+    <td>B</td>
+    <td>C</td>
+  </tr>
+</table>
+
+<p>Paragraph after.</p>
+^D
+Paragraph before.
+
+#{set text(size: 3em); table(
+  columns: 3,
+  align: (auto,auto,auto,),
+  [A], [B], [C],
+)}
+Paragraph after.
+```
+
+
+```
+% pandoc -f html -t typst
+<p>Paragraph before.</p>
+
+<table typst:text:size="3em">
+  <tr>
+    <td>A</td>
+    <td>B</td>
+    <td>C</td>
+  </tr>
+</table>
+
+<p>Paragraph after.</p>
+^D
+Paragraph before.
+
+#figure(
+  align(center)[#set text(size: 3em); #table(
+    columns: 3,
+    align: (auto,auto,auto,),
+    [A], [B], [C],
+  )]
+  , kind: table
+  )
+
+Paragraph after.
+```
+
+
+```
+% pandoc -f html -t typst
+<p>Paragraph before.</p>
+
+<table class="typst:no-figure">
+  <tr>
+    <td>A</td>
+    <td>B</td>
+    <td>C</td>
+  </tr>
+</table>
+
+<p>Paragraph after.</p>
+^D
+Paragraph before.
+
+#table(
+  columns: 3,
+  align: (auto,auto,auto,),
+  [A], [B], [C],
+)
+Paragraph after.
+```
diff --git a/test/command/wikilinks_title_after_pipe.md b/test/command/wikilinks_title_after_pipe.md
--- a/test/command/wikilinks_title_after_pipe.md
+++ b/test/command/wikilinks_title_after_pipe.md
@@ -11,20 +11,20 @@
 
 [[name of page|title]]
 ^D
-<p><a href="https://example.org" title="wikilink">https://example.org</a></p>
-<p><a href="https://example.org" title="wikilink">title</a></p>
-<p><a href="name of page" title="wikilink">name of page</a></p>
-<p><a href="name of page" title="wikilink">title</a></p>
+<p><a href="https://example.org" class="wikilink">https://example.org</a></p>
+<p><a href="https://example.org" class="wikilink">title</a></p>
+<p><a href="name of page" class="wikilink">name of page</a></p>
+<p><a href="name of page" class="wikilink">title</a></p>
 ```
 
 ## Writer
 
 ```
 % pandoc -t commonmark_x+wikilinks_title_after_pipe -f html
-<p><a href="https://example.org" title="wikilink">https://example.org</a></p>
-<p><a href="https://example.org" title="wikilink">title</a></p>
-<p><a href="Home" title="wikilink">Home</a></p>
-<p><a href="Name of page" title="wikilink">Title</a></p>
+<p><a href="https://example.org" class="wikilink">https://example.org</a></p>
+<p><a href="https://example.org" class="wikilink">title</a></p>
+<p><a href="Home" class="wikilink">Home</a></p>
+<p><a href="Name of page" class="wikilink">Title</a></p>
 ^D
 [[https://example.org]]
 
@@ -48,20 +48,20 @@
 
 [[name of page|title]]
 ^D
-<p><a href="https://example.org" title="wikilink">https://example.org</a></p>
-<p><a href="https://example.org" title="wikilink">title</a></p>
-<p><a href="name of page" title="wikilink">name of page</a></p>
-<p><a href="name of page" title="wikilink">title</a></p>
+<p><a href="https://example.org" class="wikilink">https://example.org</a></p>
+<p><a href="https://example.org" class="wikilink">title</a></p>
+<p><a href="name of page" class="wikilink">name of page</a></p>
+<p><a href="name of page" class="wikilink">title</a></p>
 ```
 
 ## Writer
 
 ```
 % pandoc -t markdown+wikilinks_title_after_pipe -f html
-<p><a href="https://example.org" title="wikilink">https://example.org</a></p>
-<p><a href="https://example.org" title="wikilink">title</a></p>
-<p><a href="Home" title="wikilink">Home</a></p>
-<p><a href="Name of page" title="wikilink">Title</a></p>
+<p><a href="https://example.org" class="wikilink">https://example.org</a></p>
+<p><a href="https://example.org" class="wikilink">title</a></p>
+<p><a href="Home" class="wikilink">Home</a></p>
+<p><a href="Name of page" class="wikilink">Title</a></p>
 ^D
 [[https://example.org]]
 
diff --git a/test/command/wikilinks_title_before_pipe.md b/test/command/wikilinks_title_before_pipe.md
--- a/test/command/wikilinks_title_before_pipe.md
+++ b/test/command/wikilinks_title_before_pipe.md
@@ -12,20 +12,20 @@
 
 [[Title|Name of page]]
 ^D
-<p><a href="https://example.org" title="wikilink">https://example.org</a></p>
-<p><a href="https://example.org" title="wikilink">title</a></p>
-<p><a href="Name of page" title="wikilink">Name of page</a></p>
-<p><a href="Name of page" title="wikilink">Title</a></p>
+<p><a href="https://example.org" class="wikilink">https://example.org</a></p>
+<p><a href="https://example.org" class="wikilink">title</a></p>
+<p><a href="Name of page" class="wikilink">Name of page</a></p>
+<p><a href="Name of page" class="wikilink">Title</a></p>
 ```
 
 ## Writer
 
 ```
 % pandoc -t commonmark_x+wikilinks_title_before_pipe -f html
-<p><a href="https://example.org" title="wikilink">https://example.org</a></p>
-<p><a href="https://example.org" title="wikilink">title</a></p>
-<p><a href="Home" title="wikilink">Home</a></p>
-<p><a href="Name of page" title="wikilink">Title</a></p>
+<p><a href="https://example.org" class="wikilink">https://example.org</a></p>
+<p><a href="https://example.org" class="wikilink">title</a></p>
+<p><a href="Home" class="wikilink">Home</a></p>
+<p><a href="Name of page" class="wikilink">Title</a></p>
 ^D
 [[https://example.org]]
 
@@ -59,20 +59,20 @@
 
 [[Title|Name of page]]
 ^D
-<p><a href="https://example.org" title="wikilink">https://example.org</a></p>
-<p><a href="https://example.org" title="wikilink">title</a></p>
-<p><a href="Name of page" title="wikilink">Name of page</a></p>
-<p><a href="Name of page" title="wikilink">Title</a></p>
+<p><a href="https://example.org" class="wikilink">https://example.org</a></p>
+<p><a href="https://example.org" class="wikilink">title</a></p>
+<p><a href="Name of page" class="wikilink">Name of page</a></p>
+<p><a href="Name of page" class="wikilink">Title</a></p>
 ```
 
 ## Writer
 
 ```
 % pandoc -t markdown+wikilinks_title_before_pipe -f html
-<p><a href="https://example.org" title="wikilink">https://example.org</a></p>
-<p><a href="https://example.org" title="wikilink">title</a></p>
-<p><a href="Home" title="wikilink">Home</a></p>
-<p><a href="Name of page" title="wikilink">Title</a></p>
+<p><a href="https://example.org" class="wikilink">https://example.org</a></p>
+<p><a href="https://example.org" class="wikilink">title</a></p>
+<p><a href="Home" class="wikilink">Home</a></p>
+<p><a href="Name of page" class="wikilink">Title</a></p>
 ^D
 [[https://example.org]]
 
diff --git a/test/docx/golden/block_quotes.docx b/test/docx/golden/block_quotes.docx
Binary files a/test/docx/golden/block_quotes.docx and b/test/docx/golden/block_quotes.docx differ
diff --git a/test/docx/golden/codeblock.docx b/test/docx/golden/codeblock.docx
Binary files a/test/docx/golden/codeblock.docx and b/test/docx/golden/codeblock.docx differ
diff --git a/test/docx/golden/comments.docx b/test/docx/golden/comments.docx
Binary files a/test/docx/golden/comments.docx and b/test/docx/golden/comments.docx differ
diff --git a/test/docx/golden/custom_style_no_reference.docx b/test/docx/golden/custom_style_no_reference.docx
Binary files a/test/docx/golden/custom_style_no_reference.docx and b/test/docx/golden/custom_style_no_reference.docx differ
diff --git a/test/docx/golden/custom_style_preserve.docx b/test/docx/golden/custom_style_preserve.docx
Binary files a/test/docx/golden/custom_style_preserve.docx and b/test/docx/golden/custom_style_preserve.docx differ
diff --git a/test/docx/golden/custom_style_reference.docx b/test/docx/golden/custom_style_reference.docx
Binary files a/test/docx/golden/custom_style_reference.docx and b/test/docx/golden/custom_style_reference.docx differ
diff --git a/test/docx/golden/definition_list.docx b/test/docx/golden/definition_list.docx
Binary files a/test/docx/golden/definition_list.docx and b/test/docx/golden/definition_list.docx differ
diff --git a/test/docx/golden/document-properties-short-desc.docx b/test/docx/golden/document-properties-short-desc.docx
Binary files a/test/docx/golden/document-properties-short-desc.docx and b/test/docx/golden/document-properties-short-desc.docx differ
diff --git a/test/docx/golden/document-properties.docx b/test/docx/golden/document-properties.docx
Binary files a/test/docx/golden/document-properties.docx and b/test/docx/golden/document-properties.docx differ
diff --git a/test/docx/golden/headers.docx b/test/docx/golden/headers.docx
Binary files a/test/docx/golden/headers.docx and b/test/docx/golden/headers.docx differ
diff --git a/test/docx/golden/image.docx b/test/docx/golden/image.docx
Binary files a/test/docx/golden/image.docx and b/test/docx/golden/image.docx differ
diff --git a/test/docx/golden/inline_code.docx b/test/docx/golden/inline_code.docx
Binary files a/test/docx/golden/inline_code.docx and b/test/docx/golden/inline_code.docx differ
diff --git a/test/docx/golden/inline_formatting.docx b/test/docx/golden/inline_formatting.docx
Binary files a/test/docx/golden/inline_formatting.docx and b/test/docx/golden/inline_formatting.docx differ
diff --git a/test/docx/golden/inline_images.docx b/test/docx/golden/inline_images.docx
Binary files a/test/docx/golden/inline_images.docx and b/test/docx/golden/inline_images.docx differ
diff --git a/test/docx/golden/link_in_notes.docx b/test/docx/golden/link_in_notes.docx
Binary files a/test/docx/golden/link_in_notes.docx and b/test/docx/golden/link_in_notes.docx differ
diff --git a/test/docx/golden/links.docx b/test/docx/golden/links.docx
Binary files a/test/docx/golden/links.docx and b/test/docx/golden/links.docx differ
diff --git a/test/docx/golden/lists.docx b/test/docx/golden/lists.docx
Binary files a/test/docx/golden/lists.docx and b/test/docx/golden/lists.docx differ
diff --git a/test/docx/golden/lists_9994.docx b/test/docx/golden/lists_9994.docx
Binary files a/test/docx/golden/lists_9994.docx and b/test/docx/golden/lists_9994.docx differ
diff --git a/test/docx/golden/lists_continuing.docx b/test/docx/golden/lists_continuing.docx
Binary files a/test/docx/golden/lists_continuing.docx and b/test/docx/golden/lists_continuing.docx differ
diff --git a/test/docx/golden/lists_div_bullets.docx b/test/docx/golden/lists_div_bullets.docx
Binary files a/test/docx/golden/lists_div_bullets.docx and b/test/docx/golden/lists_div_bullets.docx differ
diff --git a/test/docx/golden/lists_multiple_initial.docx b/test/docx/golden/lists_multiple_initial.docx
Binary files a/test/docx/golden/lists_multiple_initial.docx and b/test/docx/golden/lists_multiple_initial.docx differ
diff --git a/test/docx/golden/lists_restarting.docx b/test/docx/golden/lists_restarting.docx
Binary files a/test/docx/golden/lists_restarting.docx and b/test/docx/golden/lists_restarting.docx differ
diff --git a/test/docx/golden/nested_anchors_in_header.docx b/test/docx/golden/nested_anchors_in_header.docx
Binary files a/test/docx/golden/nested_anchors_in_header.docx and b/test/docx/golden/nested_anchors_in_header.docx differ
diff --git a/test/docx/golden/notes.docx b/test/docx/golden/notes.docx
Binary files a/test/docx/golden/notes.docx and b/test/docx/golden/notes.docx differ
diff --git a/test/docx/golden/raw-blocks.docx b/test/docx/golden/raw-blocks.docx
Binary files a/test/docx/golden/raw-blocks.docx and b/test/docx/golden/raw-blocks.docx differ
diff --git a/test/docx/golden/raw-bookmarks.docx b/test/docx/golden/raw-bookmarks.docx
Binary files a/test/docx/golden/raw-bookmarks.docx and b/test/docx/golden/raw-bookmarks.docx differ
diff --git a/test/docx/golden/table_one_row.docx b/test/docx/golden/table_one_row.docx
Binary files a/test/docx/golden/table_one_row.docx and b/test/docx/golden/table_one_row.docx differ
diff --git a/test/docx/golden/table_with_list_cell.docx b/test/docx/golden/table_with_list_cell.docx
Binary files a/test/docx/golden/table_with_list_cell.docx and b/test/docx/golden/table_with_list_cell.docx differ
diff --git a/test/docx/golden/tables-default-widths.docx b/test/docx/golden/tables-default-widths.docx
Binary files a/test/docx/golden/tables-default-widths.docx and b/test/docx/golden/tables-default-widths.docx differ
diff --git a/test/docx/golden/tables.docx b/test/docx/golden/tables.docx
Binary files a/test/docx/golden/tables.docx and b/test/docx/golden/tables.docx differ
diff --git a/test/docx/golden/tables_separated_with_rawblock.docx b/test/docx/golden/tables_separated_with_rawblock.docx
Binary files a/test/docx/golden/tables_separated_with_rawblock.docx and b/test/docx/golden/tables_separated_with_rawblock.docx differ
diff --git a/test/docx/golden/task_list.docx b/test/docx/golden/task_list.docx
Binary files a/test/docx/golden/task_list.docx and b/test/docx/golden/task_list.docx differ
diff --git a/test/docx/golden/track_changes_deletion.docx b/test/docx/golden/track_changes_deletion.docx
Binary files a/test/docx/golden/track_changes_deletion.docx and b/test/docx/golden/track_changes_deletion.docx differ
diff --git a/test/docx/golden/track_changes_insertion.docx b/test/docx/golden/track_changes_insertion.docx
Binary files a/test/docx/golden/track_changes_insertion.docx and b/test/docx/golden/track_changes_insertion.docx differ
diff --git a/test/docx/golden/track_changes_move.docx b/test/docx/golden/track_changes_move.docx
Binary files a/test/docx/golden/track_changes_move.docx and b/test/docx/golden/track_changes_move.docx differ
diff --git a/test/docx/golden/track_changes_scrubbed_metadata.docx b/test/docx/golden/track_changes_scrubbed_metadata.docx
Binary files a/test/docx/golden/track_changes_scrubbed_metadata.docx and b/test/docx/golden/track_changes_scrubbed_metadata.docx differ
diff --git a/test/docx/golden/unicode.docx b/test/docx/golden/unicode.docx
Binary files a/test/docx/golden/unicode.docx and b/test/docx/golden/unicode.docx differ
diff --git a/test/docx/golden/verbatim_subsuper.docx b/test/docx/golden/verbatim_subsuper.docx
Binary files a/test/docx/golden/verbatim_subsuper.docx and b/test/docx/golden/verbatim_subsuper.docx differ
diff --git a/test/mediawiki-reader.native b/test/mediawiki-reader.native
--- a/test/mediawiki-reader.native
+++ b/test/mediawiki-reader.native
@@ -254,40 +254,46 @@
       [ Str "internal" , Space , Str "links" ]
   , Para
       [ Link
-          ( "" , [] , [] ) [ Str "Help" ] ( "Help" , "wikilink" )
+          ( "" , [ "wikilink" ] , [] )
+          [ Str "Help" ]
+          ( "Help" , "Help" )
       ]
   , Para
       [ Link
-          ( "" , [] , [] )
+          ( "" , [ "wikilink" ] , [] )
           [ Str "the" , Space , Str "help" , Space , Str "page" ]
-          ( "Help" , "wikilink" )
+          ( "Help" , "the help page" )
       ]
   , Para
       [ Link
-          ( "" , [] , [] ) [ Str "Helpers" ] ( "Help" , "wikilink" )
+          ( "" , [ "wikilink" ] , [] )
+          [ Str "Helpers" ]
+          ( "Help" , "Help" )
       ]
   , Para
       [ Link
-          ( "" , [] , [] ) [ Str "Help" ] ( "Help" , "wikilink" )
+          ( "" , [ "wikilink" ] , [] )
+          [ Str "Help" ]
+          ( "Help" , "Help" )
       , Str "ers"
       ]
   , Para
       [ Link
-          ( "" , [] , [] )
+          ( "" , [ "wikilink" ] , [] )
           [ Str "Contents" ]
-          ( "Help:Contents" , "wikilink" )
+          ( "Help:Contents" , "Contents" )
       ]
   , Para
       [ Link
-          ( "" , [] , [] )
+          ( "" , [ "wikilink" ] , [] )
           [ Str "#My" , Space , Str "anchor" ]
-          ( "#My_anchor" , "wikilink" )
+          ( "#My_anchor" , "#My anchor" )
       ]
   , Para
       [ Link
-          ( "" , [] , [] )
+          ( "" , [ "wikilink" ] , [] )
           [ Str "and" , Space , Str "text" ]
-          ( "Page#with_anchor" , "wikilink" )
+          ( "Page#with_anchor" , "and text" )
       ]
   , Header 2 ( "images" , [] , [] ) [ Str "images" ]
   , Figure
diff --git a/test/odt/native/imageIndex.native b/test/odt/native/imageIndex.native
--- a/test/odt/native/imageIndex.native
+++ b/test/odt/native/imageIndex.native
@@ -1,1 +1,28 @@
-[Para [Image ("",[],[("width","5.292cm"),("height","5.292cm")]) [Str "Abbildung",Space,Str "1:",Space,Str "Image",Space,Str "caption"] ("Pictures/10000000000000FA000000FAD6A15225.jpg","fig:")]]
+[ Figure
+  ( "" , [] , [] )
+  (Caption
+     Nothing
+     [ Plain
+         [ Str "Image"
+         , Space
+         , Str "caption"
+         ]
+     ])
+  [ Plain
+      [ Image
+          ( ""
+          , []
+          , [ ( "width" , "5.292cm" ) , ( "height" , "5.292cm" ) ]
+          )
+          [ Str "Abbildung"
+          , Space
+          , Str "1:"
+          , Space
+          , Str "Image"
+          , Space
+          , Str "caption"
+          ]
+          ( "Pictures/10000000000000FA000000FAD6A15225.jpg" , "" )
+      ]
+  ]
+]
diff --git a/test/odt/native/imageWithCaption.native b/test/odt/native/imageWithCaption.native
--- a/test/odt/native/imageWithCaption.native
+++ b/test/odt/native/imageWithCaption.native
@@ -1,1 +1,28 @@
-[Para [Image ("",[],[("width","5.292cm"),("height","5.292cm")]) [Str "Abbildung",Space,Str "1:",Space,Str "Image",Space,Str "caption"] ("Pictures/10000000000000FA000000FAD6A15225.jpg","fig:")]]
+[ Figure
+  ( "" , [] , [] )
+  (Caption
+     Nothing
+     [ Plain
+         [ Str "Image"
+         , Space
+         , Str "caption"
+         ]
+     ])
+  [ Plain
+      [ Image
+          ( ""
+          , []
+          , [ ( "width" , "5.292cm" ) , ( "height" , "5.292cm" ) ]
+          )
+          [ Str "Abbildung"
+          , Space
+          , Str "1:"
+          , Space
+          , Str "Image"
+          , Space
+          , Str "caption"
+          ]
+          ( "Pictures/10000000000000FA000000FAD6A15225.jpg" , "" )
+      ]
+  ]
+]
diff --git a/test/odt/native/listContinueNumbering2.native b/test/odt/native/listContinueNumbering2.native
--- a/test/odt/native/listContinueNumbering2.native
+++ b/test/odt/native/listContinueNumbering2.native
@@ -1,27 +1,23 @@
 [ OrderedList
     ( 1 , Decimal , Period )
-    [ [ BlockQuote [ Para [ Str "Top" , Space , Str "one" ] ]
+    [ [ Para [ Str "Top" , Space , Str "one" ]
       , OrderedList
           ( 1 , LowerAlpha , Period )
-          [ [ BlockQuote
-                [ Para
-                    [ Str "Sub"
-                    , Space
-                    , Str "item"
-                    , Space
-                    , Str "1.a"
-                    ]
-                ]
+          [[ Plain
+             [ Str "Sub"
+             , Space
+             , Str "item"
+             , Space
+             , Str "1.a"
+             ]
             ]
-          , [ BlockQuote
-                [ Para
-                    [ Str "Sub"
-                    , Space
-                    , Str "item"
-                    , Space
-                    , Str "1.b"
-                    ]
-                ]
+          , [ Plain
+              [ Str "Sub"
+              , Space
+              , Str "item"
+              , Space
+              , Str "1.b"
+              ]
             ]
           ]
       ]
@@ -39,28 +35,24 @@
 , Para []
 , OrderedList
     ( 2 , Decimal , Period )
-    [ [ BlockQuote [ Para [ Str "Top" , Space , Str "two" ] ]
+    [ [ Para [ Str "Top" , Space , Str "two" ]
       , OrderedList
           ( 1 , LowerAlpha , Period )
-          [ [ BlockQuote
-                [ Para
-                    [ Str "Sub"
-                    , Space
-                    , Str "item"
-                    , Space
-                    , Str "2.a"
-                    ]
-                ]
+          [ [ Plain
+              [ Str "Sub"
+              , Space
+              , Str "item"
+              , Space
+              , Str "2.a"
+              ]
             ]
-          , [ BlockQuote
-                [ Para
-                    [ Str "Sub"
-                    , Space
-                    , Str "item"
-                    , Space
-                    , Str "2.b"
-                    ]
-                ]
+          , [ Plain
+              [ Str "Sub"
+              , Space
+              , Str "item"
+              , Space
+              , Str "2.b"
+              ]
             ]
           ]
       ]
@@ -78,28 +70,24 @@
 , Para []
 , OrderedList
     ( 3 , Decimal , Period )
-    [ [ BlockQuote [ Para [ Str "Top" , Space , Str "three" ] ]
+    [ [ Para [ Str "Top" , Space , Str "three" ]
       , OrderedList
           ( 1 , LowerAlpha , Period )
-          [ [ BlockQuote
-                [ Para
-                    [ Str "Sub"
-                    , Space
-                    , Str "item"
-                    , Space
-                    , Str "3.a"
-                    ]
-                ]
+          [ [ Plain
+              [ Str "Sub"
+              , Space
+              , Str "item"
+              , Space
+              , Str "3.a"
+              ]
             ]
-          , [ BlockQuote
-                [ Para
-                    [ Str "Sub"
-                    , Space
-                    , Str "item"
-                    , Space
-                    , Str "3.b"
-                    ]
-                ]
+          , [ Plain
+              [ Str "Sub"
+              , Space
+              , Str "item"
+              , Space
+              , Str "3.b"
+              ]
             ]
           ]
       ]
diff --git a/test/pod-reader.native b/test/pod-reader.native
--- a/test/pod-reader.native
+++ b/test/pod-reader.native
@@ -22,8 +22,7 @@
     , Space
     , Str "pandoc."
     ]
-, Para
-    [ Str "=head2" , Space , Str "Head" , Space , Str "2" ]
+, Header 2 ( "" , [] , [] ) [ Str "Head" , Space , Str "2" ]
 , Header
     3
     ( "" , [] , [] )
diff --git a/test/twiki-reader.native b/test/twiki-reader.native
--- a/test/twiki-reader.native
+++ b/test/twiki-reader.native
@@ -153,15 +153,15 @@
       [ Str "internal" , Space , Str "links" ]
   , Para
       [ Link
-          ( "" , [] , [] )
+          ( "" , [ "wikilink" ] , [] )
           [ Str "MySimplePage" ]
-          ( "MySimplePage" , "wikilink" )
+          ( "MySimplePage" , "" )
       ]
   , Para
       [ Link
-          ( "" , [] , [] )
+          ( "" , [ "wikilink" ] , [] )
           [ Str "My23Page23" ]
-          ( "My23Page23" , "wikilink" )
+          ( "My23Page23" , "" )
       ]
   , Header
       1
diff --git a/test/vimwiki-reader.native b/test/vimwiki-reader.native
--- a/test/vimwiki-reader.native
+++ b/test/vimwiki-reader.native
@@ -559,13 +559,13 @@
       [ Str "internal" , Space , Str "links" ]
   , Para
       [ Link
-          ( "" , [] , [] )
+          ( "" , [ "wikilink" ] , [] )
           [ Str "This is a link" ]
-          ( "This is a link" , "wikilink" )
+          ( "This is a link" , "" )
       ]
   , Para
       [ Link
-          ( "" , [] , [] )
+          ( "" , [ "wikilink" ] , [] )
           [ Str "Description"
           , Space
           , Str "of"
@@ -574,27 +574,27 @@
           , Space
           , Str "link"
           ]
-          ( "This is a link source" , "wikilink" )
+          ( "This is a link source" , "" )
       ]
   , Para
       [ Link
-          ( "" , [] , [] )
+          ( "" , [ "wikilink" ] , [] )
           [ Str "projects/Important Project 1" ]
-          ( "projects/Important Project 1" , "wikilink" )
+          ( "projects/Important Project 1" , "" )
       , SoftBreak
       , Link
-          ( "" , [] , [] )
+          ( "" , [ "wikilink" ] , [] )
           [ Str "../index" ]
-          ( "../index" , "wikilink" )
+          ( "../index" , "" )
       , SoftBreak
       , Link
-          ( "" , [] , [] )
+          ( "" , [ "wikilink" ] , [] )
           [ Str "Other" , Space , Str "files" ]
-          ( "a subdirectory/" , "wikilink" )
+          ( "a subdirectory/" , "" )
       ]
   , Para
       [ Link
-          ( "" , [] , [] )
+          ( "" , [ "wikilink" ] , [] )
           [ Str "try"
           , Space
           , Str "me"
@@ -607,11 +607,11 @@
           , Space
           , Str "anchors"
           ]
-          ( "#tag-one" , "wikilink" )
+          ( "#tag-one" , "" )
       ]
   , Para
       [ Link
-          ( "" , [] , [] )
+          ( "" , [ "wikilink" ] , [] )
           [ Str "try"
           , Space
           , Str "me"
@@ -624,11 +624,11 @@
           , Space
           , Str "anchors"
           ]
-          ( "#block quotes" , "wikilink" )
+          ( "#block quotes" , "" )
       ]
   , Para
       [ Link
-          ( "" , [] , [] )
+          ( "" , [ "wikilink" ] , [] )
           [ Str "try"
           , Space
           , Str "me"
@@ -641,19 +641,19 @@
           , Space
           , Str "anchors"
           ]
-          ( "#strong" , "wikilink" )
+          ( "#strong" , "" )
       ]
   , Para
       [ Link
-          ( "" , [] , [] )
+          ( "" , [ "wikilink" ] , [] )
           [ Str "Tasks" , Space , Str "for" , Space , Str "tomorrow" ]
-          ( "Todo List#Tomorrow" , "wikilink" )
+          ( "Todo List#Tomorrow" , "" )
       ]
   , Para
       [ Link
-          ( "" , [] , [] )
+          ( "" , [ "wikilink" ] , [] )
           [ Str "diary:2017-05-01" ]
-          ( "diary/2017-05-01" , "wikilink" )
+          ( "diary/2017-05-01" , "" )
       ]
   , Para
       [ Link
diff --git a/test/writer.html4 b/test/writer.html4
--- a/test/writer.html4
+++ b/test/writer.html4
@@ -110,8 +110,8 @@
      overflow: visible;
     }
     hr {
-      background-color: #1a1a1a;
       border: none;
+      border-top: 1px solid #1a1a1a;
       height: 1px;
       margin: 1em 0;
     }
diff --git a/test/writer.html5 b/test/writer.html5
--- a/test/writer.html5
+++ b/test/writer.html5
@@ -110,8 +110,8 @@
      overflow: visible;
     }
     hr {
-      background-color: #1a1a1a;
       border: none;
+      border-top: 1px solid #1a1a1a;
       height: 1px;
       margin: 1em 0;
     }
diff --git a/test/writer.ms b/test/writer.ms
--- a/test/writer.ms
+++ b/test/writer.ms
@@ -134,7 +134,7 @@
 In Markdown 1.0.0 and earlier.
 Version 8.
 This line turns into a list item.
-Because a hard\-wrapped line in the middle of a paragraph looked like a list
+Because a hard-wrapped line in the middle of a paragraph looked like a list
 item.
 .PP
 Here\[cq]s one with a bullet.
@@ -149,7 +149,7 @@
 .pdfhref O 1 "Block Quotes"
 .pdfhref M "block-quotes"
 .LP
-E\-mail style:
+E-mail style:
 .QS
 .LP
 This is a block quote.
@@ -197,7 +197,7 @@
 .IP
 .nf
 \f[C]
-\-\-\-\- (should be four hyphens)
+---- (should be four hyphens)
 
 sub status {
     print \[dq]working\[dq];
@@ -605,7 +605,7 @@
 .IP
 .nf
 \f[C]
-<!\-\- Comment \-\->
+<!-- Comment -->
 \f[]
 .fi
 .LP
@@ -695,7 +695,7 @@
 .IP \[bu] 3
 @223@
 .IP \[bu] 3
-@p@\-Tree
+@p@-Tree
 .IP \[bu] 3
 Here\[cq]s some display math:
 .EQ
@@ -765,7 +765,7 @@
 .PP
 Right paren: )
 .PP
-Greater\-than: >
+Greater-than: >
 .PP
 Hash: #
 .PP
@@ -775,7 +775,7 @@
 .PP
 Plus: +
 .PP
-Minus: \-
+Minus: -
 .HLINE
 .SH 1
 Links
@@ -925,7 +925,7 @@
 .IP \[bu] 3
 It should.
 .LP
-An e\-mail address: \c
+An e-mail address: \c
 .pdfhref W -D "mailto:nobody%40nowhere.net" -A "\c" \
  -- "nobody\[at]nowhere.net"
 \&
@@ -937,7 +937,7 @@
 \&
 .QE
 .LP
-Auto\-links should not occur here: \f[CR]<http://example.com/>\f[R]
+Auto-links should not occur here: \f[CR]<http://example.com/>\f[R]
 .IP
 .nf
 \f[C]
diff --git a/test/writers-lang-and-dir.latex b/test/writers-lang-and-dir.latex
--- a/test/writers-lang-and-dir.latex
+++ b/test/writers-lang-and-dir.latex
@@ -2,6 +2,12 @@
 \PassOptionsToPackage{unicode}{hyperref}
 \PassOptionsToPackage{hyphens}{url}
 \documentclass[
+  ngerman,
+  british,
+  nswissgerman,
+  spanish,
+  french,
+  english,
 ]{article}
 \usepackage{xcolor}
 \usepackage{amsmath,amssymb}
@@ -41,12 +47,6 @@
 \else
 \usepackage[bidi=default]{babel}
 \fi
-\babelprovide[main,import]{english}
-\babelprovide[import]{ngerman}
-\babelprovide[import]{british}
-\babelprovide[import]{nswissgerman}
-\babelprovide[import]{spanish}
-\babelprovide[import]{french}
 % get rid of language-specific shorthands (see #6817):
 \let\LanguageShortHands\languageshorthands
 \def\languageshorthands#1{}
