Skip to content

Commit

Permalink
fix: #388 修复复制粘贴图片时,图片alt属性丢失的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsonliu committed Feb 15, 2023
1 parent 69056e4 commit 21a505a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/htmlparser.js
Original file line number Diff line number Diff line change
Expand Up @@ -738,9 +738,9 @@ const htmlParser = {
convertU(str) {
return /^\s*$/.test(str) ? '' : ` /${str}/ `;
},
convertImg(str, attr) {
const $str = str && str.length > 0 ? $str : 'image';
return `![${$str}](${attr})`;
convertImg(alt, src) {
const $alt = alt && alt.length > 0 ? alt : 'image';
return `![${$alt}](${src})`;
},
convertGraph(str, attr, data, obj) {
const $str = str && str.length > 0 ? str : 'graph';
Expand Down

0 comments on commit 21a505a

Please sign in to comment.