CARVIEW |
Select Language
HTTP/2 200
date: Tue, 29 Jul 2025 12:50:12 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-robots-tag: none
etag: W/"d5b4b1cf069de27b2ca411046fa56e5a"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=ANFg1BhCSCezt2H4BRnw209MDdy%2F1C3UF6%2BV5GpdhW3WFpnIvAsYBXJpAiLPfIhHjiiBXvhR9CusiflX%2FvgP9JHGb0vA6BqIS4%2FM3KNTeZEo0NlZWqvqzGUDWljD5z2932iCICFaZEvdyQZAQCI3NtQcREyldiBsk6W%2BrvP4M%2ByJ7tIWUVaMiGFJYvNqGsX1e2ALtmFwY%2Fly0YmNsT49OsqUrk%2F4rbPig1n1LgBqV8NXrZfGdYV%2BBQrGyImtV0Fa0PrdcKWzPrY2ZQu%2FSnXAuA%3D%3D--97qvRLqrsLXxgwol--940tfXgNcn8miCSQvF6vtQ%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.270925683.1753793411; Path=/; Domain=github.com; Expires=Wed, 29 Jul 2026 12:50:11 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Wed, 29 Jul 2026 12:50:11 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: EDA6:27E537:B2319C:D3B14A:6888C383
Extras · trentm/python-markdown2 Wiki · GitHub
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 438
Extras
IbnuAmin edited this page Jul 18, 2024
·
36 revisions
By default markdown2.py
's processing attempts to produce output exactly as
defined by https://daringfireball.net/projects/markdown/syntax -- the "Markdown
core." However, a few optional extras are also provided.
- admonitions: Enable parsing of RST admonitions.
- breaks: Control where hard breaks are inserted in the markdown.
-
code-friendly: Disable
_
and__
forem
andstrong
. -
code-color: (DEPRECATED Use
fenced-code-blocks
extra instead.) Pygments-based syntax coloring of<code>
sections. - cuddled-lists: Allow lists to be cuddled to the preceding paragraph.
- fenced-code-blocks: Allows a code block to not have to be indented by fencing it with '```' on a line before and after. Based on https://github.github.com/github-flavored-markdown/ with support for syntax highlighting.
- footnotes: support footnotes as in use on daringfireball.net and implemented in other Markdown processors (tho not in Markdown.pl v1.0.1).
- header-ids: Adds "id" attributes to headers. The id value is a slug of the header text.
-
highlightjs-lang
: Allows specifying the language which used for syntax highlighting when using fenced-code-blocks and highlightjs. -
html-classes
: Takes a dict mapping html tag names (lowercase) to a string to use for a "class" tag attribute. Currently only supports "pre", "code", "table" and "img" tags. Add an issue if you require this for other tags. -
latex
: Converts inline and block equations wrapped using$...$
or$$...$$
to MathML - link-patterns: Auto-link given regex patterns in text (e.g. bug number references, revision number references).
-
markdown-in-html: Allow the use of
markdown="1"
in a block HTML tag to have markdown processing be done on its contents. Similar to https://michelf.com/projects/php-markdown/extra/#markdown-attr but with some limitations. - metadata: Extract metadata from a leading '---'-fenced block.
-
middle-word-em
: Allows or disallows emphasis syntax in the middle of words, defaulting to allow. Disabling this means thatthis_text_here
will not be converted tothis<em>text</em>here
. -
nofollow: Add
rel="nofollow"
to all<a>
tags with an href. See https://en.wikipedia.org/wiki/Nofollow. - numbering: Create counters to number tables, figures, equations and graphs.
-
pyshell: Treats unindented Python interactive shell sessions as
<code>
blocks. (TODO: wiki page for this) -
smarty-pants
: Fancy quote, em-dash and ellipsis handling similar to https://daringfireball.net/projects/smartypants/. See old issue 42 for discussion. (TODO: wiki page for this) -
spoiler
: A special kind of blockquote commonly hidden behind a click on SO. Syntax per https://meta.stackexchange.com/a/72878. -
strike
: Parse~~strikethrough~~
formatting. -
tag-friendly
: Requires atx style headers to have a space between the # and the header text. Useful for applications that require twitter style tags to pass through the parser. - tables: Tables using the same format as GFM and PHP-Markdown Extra.
-
target-blank-links
: Addtarget="_blank"
to all<a>
tags with an href. This causes the link to be opened in a new tab upon a click. -
tg-spoiler
: Special spoiler syntax made by telegram, for more info. -
toc
: The returned HTML string gets a new "toc_html" attribute which is a Table of Contents for the document. (experimental) -
use-file-vars: Look for an Emacs-style
markdown-extras
file variable to turn on Extras. - wavedrom: Support for generating Wavedrom digital timing diagrams
- wiki-tables: Google Code Wiki table syntax support.
-
xml
: Passes one-liner processing instructions and namespaced XML tags. (TODO: wiki page for this) -
task_list
: Allows github-style task lists (i.e. check boxes), see the pull request. (TODO: wiki page for this). Notice: this extra's nametask_list
has an underscore, not a dash. - mermaid: Enables the mermaid support through the related fenced code block.
Extras are all off by default and turned on as follows on the command line:
python markdown2.py --extras name1,name2 ...
and via the module interface:
>>> import markdown2
>>> html = markdown2.markdown_path(path, ..., extras=["name1", "name2"])
>>> html = markdown2.markdown("some markdown", ..., extras=["name1", "name2"])
>>> markdowner = Markdown(..., extras=["name1", "name2"])
>>> markdowner.convert("*boo!*")
<em>boo!</em>
To turn on extras which require a arguments like html-classes turn on extras with a dictionary instead of an array:
>>> classesDict = {'img':'yourclassname'}
>>> markdowner = Markdown(extras={"tables": None, "html-classes":classesDict})
(New in v1.0.1.2) You can also now specify extras via the "markdown-extras" emacs-style local variable in the markdown text:
<!-- markdown-extras: code-friendly, footnotes -->
This markdown text will be converted with the "code-friendly" and "footnotes"
extras enabled.
or:
This markdown text will be converted with the "code-friendly" and "footnotes"
extras enabled.
<!--
Local Variables:
markdown-extras: code-friendly, footnotes
End:
-->
You can’t perform that action at this time.