| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Add new InlineProcessor class that handles inline processing much better and allows for more flexibility. This adds new InlineProcessors that no longer utilize unnecessary pretext and posttext captures. New class can accept the buffer that is being worked on and manually process the text without regex and return new replacement bounds. This helps us to handle links in a better way and handle nested brackets and logic that is too much for regular expression. The refactor also allows image links to have links/paths with spaces like links. Ref #551, #613, #590, #161.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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'])
|
| |
|
| |
|
|
|
|
|
| |
Ancestry exclusion for inline patterns.
Adds the ability for an inline pattern to define a list of ancestor tag names that should be avoided. If a pattern would create a descendant of one of the listed tag names, the pattern will not match. Fixes #596.
|
|
|
|
|
|
|
| |
Tables now handle escaped pipes when testing, in table borders, and in
the inline content. To achieve properly, a bug had to be fixed related
to appending escaped chars to the Markdown class. Now appended chars
only appear in the current instance. Lastly the first backtick in a
table can be escaped rounding out the last corner case.
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
I've decided to go with longer lines in the tests. Also fixed a couple
errors with the previous cleanup.
|
|
|
|
|
|
| |
See #253. Prior to this patch, if any inline processors returned an element
with a tail, the tail would end up empty. This resolves that issue and will
allow for #253 to be fixed. Thanks to @facelessuser for the work on this.
|
|
|
|
|
|
|
|
|
|
|
|
| |
As we chnaged the order in import trys for short names extensions
(no dot syntax), an extra test was added to the import code for the
occassion when a naming conflict exists. For example, if PyTables
is installed (module name is tables) and the user tries to use
the short name 'tables' instead of 'markdown.extensions.tables'.
Fixes #341.
Of course, this code will get ripped out when the old behavior is
fully deprecated.
|
|
|
|
|
|
| |
The new option parser assumes bool values if the default is bool or
None. As the "title" option is not a bool value, it should default to an
empty string rather than None. Fixes #347.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The builtin extensions will no longer get special treatment and have
the path ("markdown.extensions.") appended . The same applies for
"mdx_" extensions. All names extension must provide the full path.
Fixes #336.
Also deprecating support for passing in extension config settings
as part of the string name. The extension_configs keyword should
be used instead. Fixes #335.
Also raising PendingDeprecationWarnings for positional args or the
"config" keyword on the Extension Class. Pass each setting as a
seperate keyword instead.
Docs and tests are updated. Still need to update extension API docs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The last few extensions were updated to accept dicts/**kwargs as configs and more
tests were updated. Also updated extra to actually accept configs.
Note that extra requires an extra level of dicts. First you need
to indicate tha the settings are for extra, then, which extension
extra wraps. I'm not crazy abount this, bit not sur ehow else to do it
without making all the configs a global attribute on the Markdown class
to that any extention can access any other extensions config settings.
I don't think we wnat to do that.
Also updated extra to use dot notation for the sub-extensions.
|
|
|
|
|
|
|
|
|
|
| |
All named extensions now use python dot notation in the tests - including
all builtin extensions (eg: 'extra' => 'markdown.extensions.extra'). This
is in anticipation of #336.
Note there are a few tests (in the error tests) that will still need
updating, but not till we make the change as they will test for the
new error message.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If you were to import the class like this:
from path.to.module import SomeExtensionClass
Then the named extension would be the string:
"path.to.module:SomeExtensionClass"
This should simplify loading extensions from the command line or
template filters -- expecially when multiple extensions are defined
in a single python module.
The docs still need updating. I'm waiting to update the docs after
implementing #335 and #336 as that will require a major refactor of
that section of the docs anyway.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We now use importlib which means we no longer support Python 2.6.
Also, this refactor properly imports third party extensions which reside
at the root of PYTHONPATH. Previously, either `markdown.extensions.` or
`mdx_` would be appended to any extension name that did not contain a
dot, which required third party extensions to either be in submodules or
use the old `mdx_` naming convention.
This commit is also in preperation for #336. It will now be much easier to
deprecate (and later remove) support for the old ways of handling extension
names.
|
|
|
|
|
| |
A couple scenarios with "None" were previously not accounted for.
Also updated tests which guives us 100% for markdown/util.py
|
|
|
|
| |
This should give us 100% coverage of postprocessors.py.
|
|
|
|
|
|
|
|
|
|
| |
The `--extension_configs` option must point to a YAML or JSON file.
The contents of the file must parse to a Python Dict which will be
passed to the `extension_configs` keyword of the `markdown.Markdown`
class.
Also added tests for all of the CLI option parsing options and updated
documentation.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Setting output_format must happen after extensions are loaded. Only in that
way can an extension register a serializer so that it will then be available
to be used with the output_format keyword. A test has been added to avoid
this regression from happening again in the future.
Fixes #238, partially reverses commit 41cc055 and provides a better fix for
|
|
|
|
|
|
|
| |
It is up to the markdown code (and extension authors to make sure tags are
of the correct case (there may be cases were an extension might need to
mix cases - which should be preserved). Fixes #237. Thanks for the report
@eichin.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Also added a test. Thanks for the report.
|
| |
|
|
|
|
| |
favor of testCase.assertTrue. Might as well be using the right method in our tests.
|
|
|
|
| |
unicode anyway.
|
| |
|
|
|
|
| |
markdown.util.etree not markdown.etree. This may be a backward incompatable change for some extensions.
|
|
|
|
| |
output xhtml. This fixes #9 among other bugs. The test suite even had bad tests that should have been failing. They also have been corrected.
|
| |
|
|
|
|
| |
all instances. This was a real pain to debug, but an easy fix once I found it. Thanks to obs for the report.
|
|
|
|
| |
tree, but it still uses ElementTree Comment assinged to a node's tag to test for Comment nodes. Also no longer considering Commet nodes to be block level.
|
|
|
|
| |
third party extensions when using cElementTree.
|
|
|
|
| |
extensions. All behavior is now within the class.
|
|
|
|
| |
reorg. Also added tests to make sure erros and warnings are raised where they should be.
|
|
|
|
| |
if you need it.
|
| |
|
|
in everyones site-packages. We just need to distrubute them in the tarball for people to run before installing etc.
|