Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix padding on edited quote message #16678

Merged
merged 2 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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