aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/core.py
Commit message (Collapse)AuthorAgeFilesLines
* Move isBlockLevel to class. (#693)Waylan Limberg2018-07-311-0/+19
| | | | | Allows users and/or extensions to alter the list of block level elements. The old implementation remains with a DeprecationWarning. Fixes #575.
* Deprecate md_globals from extension API. (#697)Waylan Limberg2018-07-311-1/+1
| | | | | | In the past, most of the config was defined using globals. Today all of the config is held on the class instance. Therefore, the `md_globals` parameter is no longer necessary.
* smart_emphasis keyword > legacy_em extension.Waylan Limberg2018-07-311-9/+1
| | | | | | | | | The smart_strong extension has been removed and its behavior is now the default (smart em and smart strong are the default). The legacy_em extension restores legacy behavior (no smart em or smart strong). This completes the removal of keywords. All parser behavior is now modified by extensions, not by keywords on the Markdown class.
* Remove lazy_ol keyword. Use sane_lists extension instead.Waylan Limberg2018-07-311-2/+0
| | | | This was adapted from 11408e50 of the md3 branch.
* Consistent copyright headers.Waylan Limberg2018-07-271-0/+22
| | | | Fixes #435.
* Replace homegrown OrderedDict with purpose-built Registry. (#688)Waylan Limberg2018-07-271-3/+3
| | | | | | | | | | | | | | | | | | | All processors and patterns now get "registered" to a Registry. Each item is given a name (string) and a priority. The name is for later reference and the priority can be either an integer or float and is used to sort. Priority is sorted from highest to lowest. A Registry instance is a list-like iterable with the items auto-sorted by priority. If two items have the same priority, then they are listed in the order there were "registered". Registering a new item with the same name as an already registered item replaces the old item with the new item (however, the new item is sorted by its newly assigned priority). To remove an item, "deregister" it by name or index. A backwards compatible shim is included so that existing simple extensions should continue to work. DeprecationWarnings will be raised for any code which calls the old API. Fixes #418.
* More acurate Extension type error msg.Waylan Limberg2018-07-241-3/+5
|
* Moved enable_attributes keyword to extension: legacy_attrs.Waylan Limberg2018-07-241-2/+0
| | | | | | | If you have existing documents that use the legacy attributes format, then you should enable the legacy_attrs extension for those documents. Everyone is encouraged to use the attr_list extension going forward. Closes #643. Work adapted from 0005d7a of the md3 branch.
* Simplify output_formats to html and xhtml.Waylan Limberg2018-01-251-18/+4
| | | | | | | | | | | We started with the numbers before HTML5 was a thing and we thought there might be an XHTML2. Today, we know that all we have are HTML style tags and XHTML style tags. Nothing else really matters in the real world. Note that if '(x)html1' '(x)html4' or '(x)html5' are passed in, the number is stripped/ignored. Users shouldn't need to change their code for this.
* Improve test coverage.Waylan Limberg2018-01-131-5/+4
|
* Refactor Extension loading (#627)Waylan Limberg2018-01-121-60/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deprecated naming support is removed: * Removed special treatment for modules in `markdown.extensions` * Removed support for `mdx_` prefixes. Support for Entry Point names added: Support for "short names" are now implemented with entry points. Therefore all the users who call extension names as `toc` will not get errors as the builtin extensions all have entry points defined which match the old "short names" for modules in `markdown.extensions`. The benefit is that any extension can offer the same support without requiring the user to manually copy a file to that location on the file system (way to many extension authors have included such instructions in their installation documentation). The one odd thing about this is that we have been issuing a DeprecationWarning for short names and now they are fully supported again. But I think it's the right thing to do. Support for using dot notation is not removed. After all, it was never deprecated. And we shouldn't "force" entry points. There are plenty of reasons why users may not want that and not all of them can be resolved by using class instances instead. All of the following ways to load an extension are valid: # Class instance from markdown.extensions.toc import TocExtension markdown.markdown(src, extensions=[TocExtension()] # Entry point name markdown.markdown(src, extensions=['toc']) # Dot notation with class markdown.markdown(src, extensions=['markdown.extensions.toc:TocExtension']) # Dot notation without class markdown.markdown(src, extensions=['markdown.extensions.toc'])
* Removed deprecated safe_mode.Waylan Limberg2018-01-111-23/+1
|
* Removed support for deprecated config in ext name.Waylan Limberg2018-01-111-19/+2
|
* Removed deprecated support for positional args.Waylan Limberg2018-01-111-32/+4
|
* Moved core to core.pyWaylan Limberg2018-01-111-0/+496
__version__ is now in __init__.py (as is should be) and the core is defined in core.py. Other than version, __init__.py is just a dummy which imports the pieces we make public.