aboutsummaryrefslogtreecommitdiff
path: root/docs/extensions/legacy_em.md
blob: 67c6cd0068415ee5d6759b7b85f337bb9b8bc09f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
title: Legacy EM Extension

# Legacy EM

## Summary

The Legacy EM extension restores Markdown's original behavior for emphasis and
strong syntax when using underscores.

By default Python-Markdown treats `_connected_words_` intelligently by
recognizing that mid-word underscores should not be used for emphasis. In other
words, by default, that input would result in this output:
`<em>connected_words</em>`.

However, that behavior is not consistent with the original rules or the behavior
of the reference implementation. Therefore, this extension can be used to better
match the reference implementation. With the extension enabled, the above input
would result in this output: `<em>connected</em>words_`.

## Usage

See [Extensions](index.md) for general extension usage. Use `legacy_em` as the
name of the extension.

This extension does not accept any special configuration options.

A trivial example:

```python
markdown.markdown(some_text, extensions=['legacy_em'])
```