mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-09-11 15:14:31 +08:00
fix(composer): get rid of extra blank lines on paste
Test Plan: edgehill --test Reviewers: bengotow Reviewed By: bengotow Differential Revision: https://review.inboxapp.com/D1357
This commit is contained in:
parent
e5f3f3087b
commit
1c56e5c15b
1 changed files with 7 additions and 1 deletions
|
@ -645,8 +645,14 @@ ContenteditableComponent = React.createClass
|
|||
blockquote: "p"
|
||||
table: "p"
|
||||
|
||||
cleanHtml.replace(/<p>/gi, "").replace(/<\/p>/gi, "<br/><br/>")
|
||||
# We sanitized everything and convert all whitespace-inducing elements
|
||||
# into <p> tags. We want to de-wrap <p> tags and replace with two line
|
||||
# breaks instead.
|
||||
cleanHTML = cleanHtml.replace(/<p[\s\S]*?>/gim, "").replace(/<\/p>/gi, "<br/><br/>")
|
||||
|
||||
# We never want more then 2 line breaks in a row.
|
||||
# https://regex101.com/r/gF6bF4/2
|
||||
cleanHTML.replace(/(<br\/?>\s*){3,}/g, "<br/><br/>")
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue