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

Paste adds empty lines at the begining and the end #4620

Open
6 tasks done
inigochoa opened this issue Mar 13, 2024 · 3 comments
Open
6 tasks done

Paste adds empty lines at the begining and the end #4620

inigochoa opened this issue Mar 13, 2024 · 3 comments

Comments

@inigochoa
Copy link

Checklist

  • I've looked at the documentation to make sure the behavior isn't documented and expected.
  • I'm sure this is an issue with Summernote, not with my app or other dependencies (Angular, Cordova, React, etc.).
  • I've searched through the current issues to make sure this hasn't been reported yet.
  • My issue is pertinent to this repository of Summernote (jQuery), or I was unable to have my issue resolved from the relevant version I'm using, such as Angular, dJango, Rails or React. Please try your issue at the relevent repository first.
  • I understand that issues without interaction for more than 14 days (2 weeks), may be closed at our discretion. We do this, as sometimes issues are abandoned. We may at our discretion, add issues to the relevant project to be looked at, or for maintainers to work through as time permits. This is to help keep issues relevant to the current version of Summernote, and to reduce clutter.
  • I agree to follow the Code of Conduct that this project adheres to.

Steps to reproduce

Im pasting text from a word document. Text gets correctly split into paragraphs. However, at the end it adds a <div><br></div> making a new line. It sometimes adds that code to the begining.

I also checked that the pasted text does not end in a blank line.

FireShot Capture

Expected behavior

Pasted text should end in a paragraph.

Current behavior

Pasted text ends with a blank new line (<div><br></div>).

Minimal example reproducing the issue

No response

Environment

  • Summernote version: 0.8.20
  • Browser (with version): Brave Versión 1.63.162 Chromium: 122.0.6261.69 (Build oficial) (64 bits)
  • OS/Platform (with version): Ubuntu 22.04

No summernote extensions are used

@1der1
Copy link

1der1 commented Mar 13, 2024

MS Office content is not HTML 5. If you use it in HTML 5 context, you must convert it. Additionally, there is a lot of bloat, which can be tidied up without losing functionality.

We made a post about it: https://1der1.com/blogs/news/ms-office-to-html-in-perfection

I highly recommend: https://github.com/DiemenDesign/summernote-cleaner

@inigochoa
Copy link
Author

Thank you for the response.

We tried with summernote-cleaner but got no luck. We will leave it for now, but thanks

@DennisSuitters
Copy link
Member

If it was a while ago when you tried, just note, that there's been recent updates by another contributor. I suggest trying it again, I hope it does what you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants