github torchbox/wagtail-markdown v0.10.0
v0.10 - Markdown 3.4+, inline links with pks, extend or override settings

latest releases: v0.12.1, v0.12.0, v0.11.1...
2 years ago

This release bring a number of fixes and improvements.

🔗 Inline links

Markdown Result
[page link](page:1) <a href="/path/to/page-1/">page link</a>
[document link](doc:3) <a href="/documents/1/the-document.pdf">document link</a>
![image](image:37) <img alt="image" class="left" src="https://thing.public.s3.amazonaws.com/images/foo.png\">
![image](image:37,class=full-width) <img alt="image" class="full-width" src="https://thing.public.s3.amazonaws.com/images/foo.width-500.png">
![image](image:37,filter=fill-1000x1000) <img alt="image" class="left" src="https://thing.public.s3.amazonaws.com/images/foo.fill-1000x1000.png">
![image](image:37,class=full-width,filter=width-100|format-webp) <img alt="image" class="full-with" src="https://thing.public.s3.amazonaws.com/images/foo.width-100.format-webp.webp">

If you have wagtailmedia installed, you can link to a media item via [media item link text](media:123) which will produce a link to the media file.

⚙️ Additional EasyMDE options

You can now customise the EasyMDE options. To do this, create a JavaScript file in your app (for example my_app_name/static/js/easymde_custom.js) and add the following:

// my_app/static/js/easymde_custom.js
window.wagtailMarkdown = window.wagtailMarkdown || {};
window.wagtailMarkdown.options = window.wagtailMarkdown.options || {};
window.wagtailMarkdown.options.spellChecker = false;
# my_app/wagtail_hoos.py
from django.templatetags.static import static
from django.utils.html import format_html

from wagtail import hooks


@hooks.register("insert_global_admin_js", order=100)
def global_admin_js():
    """Add /static/js/admin/easymde_custom.js to the admin."""
    return format_html('<script src="{}"></script>', static("js/easymde_custom.js"))

🎛️ Settings mode

You can now change how wagtail-markdown inteprets the options you provide in the WAGTAILMARKDOWN setting via allowed_settings_mode (optional. "extend" or "override". default: "extend") for allowed_tags, allowed_styles and allowed_attributes options. And extensions_settings_mode (optional. "extend" or "override". default: "extend") for extensions and extension_configs options.

⚠️ Previously values added in the allowed_attributes option would replace the default ones, so you had to provide all values. With this change, they should be extended. (original issue)

Dropped custom tables plugin

⚠️ We no longer customise tables, therefore the resulting table markup will no longer have the wftable class.

What's Changed

Full Changelog: v0.9.0...v0.10.0

Don't miss a new wagtail-markdown release

NewReleases is sending notifications on new releases.