| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This is very much incomplete and not fully tested. Likely still a
long way to go. At least it works with a some simple stuff. However,
tails are currenlty processed twice and various now-uneeded pieces
have not yet been removed.
Added a new treeprocessor which runs inlinepatterns without the need to use
placeholders or alter patterns. Note that any pattern that made use of
groups will need to be updated (reduce each group by 1) as a result.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
This completes the removal of keywords. All parser behavior is now modified
by extensions, not by keywords on the Markdown class.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
Previously, instances of the Markdown class were represented as any one of
'md', 'md_instance', or 'markdown'. This inconsistancy made it diffcult
when developing extensions, or just maintaining the existing code.
Now, all instances are consistantly represented as 'md'.
|
|
|
|
| |
Use the TOC extension instead.
|
|
|
|
|
| |
There is no need for this anymore. In the past, most config was using
globals. Today all config is held on the class instance.
|
|
|
|
|
|
|
|
| |
The 'bin/markdown_py' script has been replaced with a 'markdown' entry point
and 'run_tests.py' with a 'mdtests' entry point.
The makefile uses 'python -m markdown.test' rather than 'mdtests' so it can run
even if the package is not installed.
|
|
|
|
| |
And misc. cleanup from adopting entrypoints for extensions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All previously supported methods of loading an extension given a string
name have now been replaced with entry points. Extension classes must be
registered as entry points in the 'markdown.extensions' group to support
string names. The old module-level 'makeExtension' function is no longer
needed. In fact, multiple extensions could be defined in one module
and still use string names if entry points are defined pointing to
each Extension subclass.
All of the build-in extensions are now registered with names that
mimic their paths (using dot notation). That may change in the future.
It is expected that all extensions will use short names. We may support
both ('extra' & 'markdown.extensions.extra') in the interim.
Also, all extension configs must now be dicts. Support for a list
of tuples has been removed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The testing framework can now be used by third party extensions to run local
tests using Python-Markdown's testing framework. All syntax tests are assumed
to be in `cwd/tests/` (where 'cwd' is the current working directory) and its
subdirectories. As previosly, UnitTests use normal discovery methods. Note
that the actual tests themselves are not in the lib, only the framework.
To run tests, from the appropriate directory (the parent dir of `tests/`)
run `python -m markdown.test`.
Note that the HTMLOutput plugin has been removed as I haven't used in in
years.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
__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.
|
| |
|
| |
|
|\
| |
| | |
Miscellaneous capitalization/spelling fixes
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
| |
The previous version did not work, and was incorrectly removed as part of
85ad18071d619251. In the new version, use lookbehind search for \w instead
of \b, so that it works.
Update the tests accordingly.
Fixes #399 (except parts that we can't fix). Thanks @gandaro for the report.
|
|
|
|
|
|
| |
A etree can contain Comments, PIs or other Elements which do not have
a string for a tag. Must always check that a tag is a string before
doing string processing on it. Otherwise, things will crash.
|
| |
|
|
|
|
|
| |
The option was buggy. Rather than try to fix it, it is being removed.
This feeture should exist as a seperate extension. Fixes #390.
|
|
|
|
| |
Fixes #389. Thanks for the report @lazka.
|
|
|
|
|
| |
Without the space, Python joins the lines and it produces results like
'Positional arguments are depreacted in MarkdownUse keyword arguments only'.
|
| |
|
|
|
|
|
|
|
| |
Apparently this is a new requirement of flake8. That's the thing about using
tox. Every test run reinstalls all dependencies so an updated dependency might
instroduce new errors. I could specify a specific version, but I like staying
current.
|
|
|
|
|
|
|
|
|
| |
Fixes #386. I'm doing this against my better judgement. The only reason is
that I'm using the HTML format suggested by the HTML5 Spec and will simply
not consider any alternate output. If a JavaScript library requires something
else, to bad. I don't care. That library should support the format
suggested by the spec or I'm not interested in it. If you want something else
then you can create your own extension which does whatever you want.
|
|
|
|
|
|
|
|
|
| |
Also checked for `None` so the existing extensions will at least still work.
Of course, that code all gets deleted with the next release and things will
break if extension authors do not update their code. Hope they test there
code with each release and check for warnings.
Also added a note to the release notes.
|
|
|
|
|
|
| |
`makeExtension` is the module level function defined in an extension,
not `extendMarkdown`, which is the method you override on the Extension class.
Do'h. Thanks for catching this @mitya57.
|
| |
|
|
|
|
|
|
|
|
|
| |
I need to remember this is a lib first and not configure logging from within
the lib. Also, from the script we are now actually displaying deprecation
warnings. For some reason I don't understnad deprecation warnings are hidden
by default in Python. And who remembers to run Python with the `-Wd` flag
every time they upgrade a lib just to make sure there's no new deprecations?
Fixes #384.
|
|
|
|
|
|
| |
Mostly just code cleanup so it reads better. Renamed a few internal things.
I didn't write this extension originally so most of this would have been
done a long time ago. I just havn't touched this code much till now.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use the Table of Contents Extension instead. The HeaderId Extension will
raise a PendingDeprecationWarning.
The last few features of the HeaderID extension were mirgrated to TOC
including the baselevel and separator config options. Also, the
marker config option of TOC can be set to an empty string to disable
searching for a marker.
The `slugify`, `unique` and `stashedHTML2text` functions are now defined
in the TOC extension in preperation for the HeaderId extension being
removed. All coresponding tests are now run against the TOC Extension.
The meta-data support of the HeaderId Extension was not migrated and no plan
exists to make that migration. The `forceid` config option makes no sense in
the TOC Extension and the only other config setting supported by meta-data
was the `header_level`. However, as that depends on the template, it makes
more sense to not be defined at the document level.
|
| |
|
|
|
|
|
|
|
|
|
| |
Fixes #380. The TOC replacement is now seperate from building the
TOC, which allows us to iter through the doc in order rather than
with the non-order-preserving interparent pethod. This is almost a
complete refactor of the run method. Also cleaned up the config stuff.
Thanks to @colewerner for the report and test case.
|
| |
|
|
|
|
|
|
|
|
| |
Previously, we only added the toc attribute (md.toc) if no Marker was
found within the document. However, that has caused framworks to do things
like force insert a marker, run convert, then extract the toc from the
body of the document. This is much cleaner. And if the user wants to add
the toc to the document also, they still can.
|