The following Markdown syntax extensions are not enabled by default
in pandoc, but may be enabled by adding +EXTENSION
to the
format name, where EXTENSION
is the name of the extension.
Thus, for example, markdown+hard_line_breaks
is Markdown
with hard line breaks.
rebase_relative_paths
Rewrite relative paths for Markdown links and images, depending on the path of the file containing the link or image link. For each link or image, pandoc will compute the directory of the containing file, relative to the working directory, and prepend the resulting path to the link or image path.
The use of this extension is best understood by example. Suppose you
have a subdirectory for each chapter of a book, chap1
,
chap2
, chap3
. Each contains a file
text.md
and a number of images used in the chapter. You
would like to have ![image](spider.jpg)
in
chap1/text.md
refer to chap1/spider.jpg
and
![image](spider.jpg)
in chap2/text.md
refer to
chap2/spider.jpg
. To do this, use
pandoc chap*/*.md -f markdown+rebase_relative_paths
Without this extension, you would have to use
![image](chap1/spider.jpg)
in chap1/text.md
and ![image](chap2/spider.jpg)
in
chap2/text.md
. Links with relative paths will be rewritten
in the same way as images.
Absolute paths and URLs are not changed. Neither are empty paths or
paths consisting entirely of a fragment, e.g., #foo
.
Note that relative paths in reference links and images will be rewritten relative to the file containing the link reference definition, not the file containing the reference link or image itself, if these differ.
mark
To highlight out a section of text, begin and end it with with
==
. Thus, for example,
This ==is deleted text.==
attributes
Allows attributes to be attached to any inline or block-level element
when parsing commonmark
. The syntax for the attributes is
the same as that used in header_attributes
.
inline_code_attributes
and
link_attributes
.)header_attributes
.)fenced_code_attributes
.)Note that pandoc’s AST does not currently allow attributes to be attached to arbitrary elements. Hence a Span or Div container will be added if needed.
old_dashes
Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes:
-
before a numeral is an en-dash, and --
is an
em-dash. This option only has an effect if smart
is
enabled. It is selected automatically for textile
input.
angle_brackets_escapable
Allow <
and >
to be
backslash-escaped, as they can be in GitHub flavored Markdown but not
original Markdown. This is implied by pandoc’s default
all_symbols_escapable
.
lists_without_preceding_blankline
Allow a list to occur right after a paragraph, with no intervening blank space.
four_space_rule
Selects the pandoc <= 2.0 behavior for parsing lists, so that four spaces indent are needed for list item continuation paragraphs.
spaced_reference_links
Allow whitespace between the two components of a reference link, for example,
[foo] [bar].
hard_line_breaks
Causes all newlines within a paragraph to be interpreted as hard line breaks instead of spaces.
ignore_line_breaks
Causes newlines within a paragraph to be ignored, rather than being treated as spaces or as hard line breaks. This option is intended for use with East Asian languages where spaces are not used between words, but text is divided into lines for readability.
east_asian_line_breaks
Causes newlines within a paragraph to be ignored, rather than being
treated as spaces or as hard line breaks, when they occur between two
East Asian wide characters. This is a better choice than
ignore_line_breaks
for texts that include a mix of East
Asian wide characters and other characters.
emoji
Parses textual emojis like :smile:
as Unicode
emoticons.
tex_math_single_backslash
Causes anything between \(
and \)
to be
interpreted as inline TeX math, and anything between \[
and
\]
to be interpreted as display TeX math. Note: a drawback
of this extension is that it precludes escaping (
and
[
.
tex_math_double_backslash
Causes anything between \\(
and \\)
to be
interpreted as inline TeX math, and anything between \\[
and \\]
to be interpreted as display TeX math.
markdown_attribute
By default, pandoc interprets material inside block-level tags as
Markdown. This extension changes the behavior so that Markdown is only
parsed inside block-level tags if the tags have the attribute
markdown=1
.
mmd_title_block
Enables a MultiMarkdown style title block at the top of the document, for example:
Title: My title
Author: John Doe
Date: September 1, 2008
Comment: This is a sample mmd title block, with
a field spanning multiple lines.
See the MultiMarkdown documentation for details. If
pandoc_title_block
or yaml_metadata_block
is
enabled, it will take precedence over mmd_title_block
.
abbreviations
Parses PHP Markdown Extra abbreviation keys, like
*[HTML]: Hypertext Markup Language
Note that the pandoc document model does not support abbreviations, so if this extension is enabled, abbreviation keys are simply skipped (as opposed to being parsed as paragraphs).
autolink_bare_uris
Makes all absolute URIs into links, even when not surrounded by
pointy braces <...>
.
mmd_link_attributes
Parses multimarkdown style key-value attributes on link and image
references. This extension should not be confused with the link_attributes
extension.
This is a reference ![image][ref] with multimarkdown attributes.
[ref]: https://path.to/image "Image title" width=20px height=30px
id=myId class="myClass1 myClass2"
mmd_header_identifiers
Parses multimarkdown style heading identifiers (in square brackets,
after the heading but before any trailing #
s in an ATX
heading).
compact_definition_lists
Activates the definition list syntax of pandoc 1.12.x and earlier. This syntax differs from the one described above under Definition lists in several respects:
gutenberg
Use Project Gutenberg
conventions for plain
output: all-caps for strong emphasis,
surround by underscores for regular emphasis, add extra blank space
around headings.
sourcepos
Include source position attributes when parsing
commonmark
. For elements that accept attributes, a
data-pos
attribute is added; other elements are placed in a
surrounding Div or Span element with a data-pos
attribute.
short_subsuperscripts
Parse multimarkdown style subscripts and superscripts, which start with a ‘~’ or ‘^’ character, respectively, and include the alphanumeric sequence that follows. For example:
x^2 = 4
or
Oxygen is O~2.
To see why laziness is incompatible with relaxing the requirement of a blank line between items, consider the following example:
bar
: definition
foo
: definition
Is this a single list item with two definitions of “bar,” the first of which is lazily wrapped, or two list items? To remove the ambiguity we must either disallow lazy wrapping or require a blank line between list items.↩︎