diff options
author | Waylan Limberg <waylan.limberg@icloud.com> | 2018-08-02 14:51:16 -0400 |
---|---|---|
committer | Waylan Limberg <waylan.limberg@icloud.com> | 2018-08-03 19:18:34 -0400 |
commit | 833574a9da27874614f7184f85f7993a539f3df1 (patch) | |
tree | 0870c17b8cb5deedee5dbd13f02469d2cc92c455 /docs/extensions/legacy_attr.md | |
parent | 1e7fd3f236f63f9ca9b85de9cd172b77e7f9be80 (diff) | |
download | markdown-833574a9da27874614f7184f85f7993a539f3df1.tar.gz markdown-833574a9da27874614f7184f85f7993a539f3df1.tar.bz2 markdown-833574a9da27874614f7184f85f7993a539f3df1.zip |
Update 3.0 release notes
And other docs cleanup.
Diffstat (limited to 'docs/extensions/legacy_attr.md')
-rw-r--r-- | docs/extensions/legacy_attr.md | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/docs/extensions/legacy_attr.md b/docs/extensions/legacy_attr.md new file mode 100644 index 0000000..0066867 --- /dev/null +++ b/docs/extensions/legacy_attr.md @@ -0,0 +1,59 @@ +title: Legacy Attributes Extension + +# Legacy Attributes + +## Summary + +The Legacy Attributes extension restores Python-Markdown's original attribute +setting syntax. Older versions of Python Markdown (prior to 3.0) included +built-in and undocumented support for defining attributes on elements. Most +users have never made use of the syntax and it has been deprecated in favor of +[Attribute Lists](attr_list.md). This extension restores the legacy behavior for +users who have existing documents which use the syntax. + +## Syntax + +Attributes are defined by including the following within the element you wish to +assign the attributes to: + +```md +{@key=value} +``` + +For example, to define a class to a paragraph: + +```md +A paragraph with the attribute defined {@class=foo}anywhere within. +``` + +Which results in the following output: + +```html +<p class="foo">A paragraph with the attribute defined anywhere within.</p> +``` + +The same applies for inline elements: + +```md +Some *emphasized{@id=bar}* text. +``` + +```html +<p>Some <em id="bar">emphasized</em> text.</p> + +You can also define attributes in images: + +```md +![Alt text{@id=baz}](path/to/image.jpg) +``` + +```html +<p><img alt="Alt text" id="baz" src="path/to/image.jpg" /></p> +``` + +## Usage + +See [Extensions](index.md) for general extension usage. Use `legacy_attr` as the +name of the extension. + +This extension does not accept any special configuration options. |