diff options
Diffstat (limited to 'docs/extensions/api.txt')
-rw-r--r-- | docs/extensions/api.txt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/docs/extensions/api.txt b/docs/extensions/api.txt index 9653883..246bb27 100644 --- a/docs/extensions/api.txt +++ b/docs/extensions/api.txt @@ -53,7 +53,7 @@ A pseudo example: Inline Patterns {: #inlinepatterns } ------------------------------------ -Inline Patterns implement the inline HTML element syntax for Markdown such as +Inline Patterns implement the inline HTML element syntax for Markdown such as `*emphasis*` or `[links](http://example.com)`. Pattern objects should be instances of classes that inherit from `markdown.inlinepatterns.Pattern` or one of its children. Each pattern object uses a single regular expression and @@ -68,6 +68,10 @@ must have the following methods: Accepts a match object and returns an ElementTree element of a plain Unicode string. +Also, Inline Patterns can define the property `ANCESTOR_EXCLUDES` with either +a list or tuple of undesirable ancestors. The pattern should not match if it +would cause the content to be a descendant of one of the defined tag names. + Note that any regular expression returned by `getCompiledRegExp` must capture the whole block. Therefore, they should all start with `r'^(.*?)'` and end with `r'(.*?)!'`. When using the default `getCompiledRegExp()` method |