DEV: Extend plugin API for uploads (#8440)

* DEV: Add API to alter uploads Markdown

* DEV: Extract data attributes from image / download Markdown

For example '[test|attachment|hello=world]' will generate an 'a' element
with a data attribute: 'data-hello=world'.

This commit also makes MarkdownIt to transform '|attachment' into
'class="attachment"'. This transformation used to be a part of the
process which resolves short URLs (i.e. upload://).

* DEV: Export imageNameFromFileName
This commit is contained in:
Dan Ungureanu
2019-12-09 16:20:03 +02:00
committed by GitHub
parent ebe6fa95be
commit aa24be1a9a
8 changed files with 118 additions and 64 deletions

View File

@@ -34,6 +34,6 @@ QUnit.test("attachments are cooked properly", async assert => {
find(".d-editor-preview:visible")
.html()
.trim(),
'<p><a href="/uploads/short-url/asdsad.png" class="attachment">test</a></p>'
'<p><a class="attachment" href="/uploads/short-url/asdsad.png">test</a></p>'
);
});