Skip to content

Commit

Permalink
Merge pull request #16678 from eh2077/fix-padding-on-edited-quote-mes…
Browse files Browse the repository at this point in the history
…sage
  • Loading branch information
dangrous authored Mar 29, 2023
2 parents a9534b8 + 8d5329f commit 6142f43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -828,8 +828,8 @@ const handleUserDeletedLinks = (newCommentText, originalHtml) => {
return newCommentText;
}
const htmlWithAutoLinks = parser.replace(newCommentText);
const markdownWithAutoLinks = parser.htmlToMarkdown(htmlWithAutoLinks);
const markdownOriginalComment = parser.htmlToMarkdown(originalHtml);
const markdownWithAutoLinks = parser.htmlToMarkdown(htmlWithAutoLinks).trim();
const markdownOriginalComment = parser.htmlToMarkdown(originalHtml).trim();
const removedLinks = getRemovedMarkdownLinks(markdownOriginalComment, newCommentText);
return removeLinks(markdownWithAutoLinks, removedLinks);
};
Expand Down Expand Up @@ -858,7 +858,7 @@ function editReportComment(reportID, originalReportAction, textForNewComment) {
let parsedOriginalCommentHTML = originalCommentHTML;
if (markdownForNewComment.length < CONST.MAX_MARKUP_LENGTH) {
htmlForNewComment = parser.replace(markdownForNewComment, autolinkFilter);
parsedOriginalCommentHTML = parser.replace(parser.htmlToMarkdown(originalCommentHTML), autolinkFilter);
parsedOriginalCommentHTML = parser.replace(parser.htmlToMarkdown(originalCommentHTML).trim(), autolinkFilter);
}

// Delete the comment if it's empty
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/report/ReportActionItemMessageEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class ReportActionItemMessageEdit extends React.Component {
this.messageEditInput = 'messageEditInput';

const parser = new ExpensiMark();
const draftMessage = parser.htmlToMarkdown(this.props.draftMessage);
const draftMessage = parser.htmlToMarkdown(this.props.draftMessage).trim();

this.state = {
draft: draftMessage,
Expand Down

0 comments on commit 6142f43

Please sign in to comment.