Include alt text and title for images added to the editor (#2098)

This commit is contained in:
Djamil Legato
2021-03-18 15:21:53 -07:00
parent c33c033372
commit ea64270d9b
3 changed files with 7 additions and 3 deletions

View File

@@ -1,6 +1,8 @@
# v1.10.8 # v1.10.8
## mm/dd/2021 ## mm/dd/2021
1. [](#improved)
* Include alt text and title for images added to the editor [#2098](https://github.com/getgrav/grav-plugin-admin/issues/2098)
1. [](#bugfix) 1. [](#bugfix)
* Fixed issue replacing `wildcard` field names in flex collections [#2092](https://github.com/getgrav/grav-plugin-admin/pull/2092) * Fixed issue replacing `wildcard` field names in flex collections [#2092](https://github.com/getgrav/grav-plugin-admin/pull/2092)

View File

@@ -335,7 +335,9 @@ export function UriToMarkdown(uri) {
uri = uri.replace(/\(/g, '%28'); uri = uri.replace(/\(/g, '%28');
uri = uri.replace(/\)/g, '%29'); uri = uri.replace(/\)/g, '%29');
return uri.match(/\.(jpe?g|png|gif|svg|mp4|webm|ogv|mov)$/i) ? `![](${uri})` : `[${decodeURI(uri)}](${uri})`; const title = uri.split('.').slice(0, -1).join('.');
return uri.match(/\.(jpe?g|png|gif|svg|mp4|webm|ogv|mov)$/i) ? `![${title}](${uri} "${title}")` : `[${decodeURI(uri)}](${uri})`;
} }
let instances = []; let instances = [];

File diff suppressed because one or more lines are too long