Skip to content

Commit

Permalink
Fixed line break replacement to only apply to alt text.
Browse files Browse the repository at this point in the history
  • Loading branch information
jglev committed Mar 9, 2023
1 parent f2a48f3 commit 8038a63
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,11 +405,16 @@ export default class PastetoIndentationPlugin extends Plugin {
"src",
encodeURI(tfileObject.path)
);

srcContainingElements[i].setAttr(
"alt",
srcContainingElements[i].getAttr('src').replaceAll('\n', ' ')
)
}
}
}

clipboardContents = htmlToMarkdown(htmlDom.documentElement.innerHTML).replaceAll('\n', ' ');
clipboardContents = htmlToMarkdown(htmlDom.documentElement.innerHTML);

// htmlToMarkdown() will return a blank string if
// there is no HTML to convert. If that is the case,
Expand Down

0 comments on commit 8038a63

Please sign in to comment.