Baidu ueditor component, after using the uploaded image, automatically displays the uploaded image in the editor, that is, inserting an tag. And set an alt attribute, whose value is the local path when uploading the image. I haven't found where to configure this value yet. When viewing the published content, I saw that the value of alt is a disk path, which is a bit awkward.
You can filter and modify the alt content after editing the content and save it to the database, or you can directly modify the source code
function callback(){ try{ var link, json, loader, body = (iframe.contentDocument || iframe.contentWindow.document).body, result = body.innerText || body.textContent || ''; json = (new Function("return " + result))(); link = me.options.imageUrlPrefix + json.url; if(json.state == 'SUCCESS' && json.url) { loader = me.document.getElementById(loadingId); loader.setAttribute('src', link); loader.setAttribute('_src', link); loader.setAttribute('title', json.title || ''); loader.setAttribute('alt', json.original || ''); loader.removeAttribute('id'); domUtils.removeClasses(loader, 'loadingclass'); } else { showErrorLoader && showErrorLoader(json.state); } }catch(er){ showErrorLoader && showErrorLoader(me.getLang('simpleupload.loadError')); } form.reset(); domUtils.un(iframe, 'load', callback); }
More Baidu ueditor components For related articles on how to set the alt attribute in img after uploading images, please pay attention to the PHP Chinese website!