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

Copy and Paste creates unnecessary DOM with duplicate style #4819

Open
sijunnoh opened this issue Sep 13, 2024 · 0 comments
Open

Copy and Paste creates unnecessary DOM with duplicate style #4819

sijunnoh opened this issue Sep 13, 2024 · 0 comments

Comments

@sijunnoh
Copy link

Expected behavior.
  • Duplicate inline styles are handled (or merged)
  • Or provide a method to handle duplicate styles
Actual behavior.
  • It creates nested unnecessary DOM element with duplicate inline style
Steps to reproduce the problem.
  • Apply inline style (ex. font family)
  • Copy text -> paste in the middle of another text with same inline style
<span style="font-family: Impact, Charcoal, sans-serif">
  test
  <span style="font-family: Impact, Charcoal, sans-serif" id="isPasted">
    testt
    <span style="font-family: Impact, Charcoal, sans-serif" id="isPasted">
      testt
      <span style="font-family: Impact, Charcoal, sans-serif" id="isPasted">
        test
        <span style="font-family: Impact, Charcoal, sans-serif" id="isPasted">
          tes
          <span style="font-family: Impact, Charcoal, sans-serif" id="isPasted">
            test
            <span style="font-family: Impact, Charcoal, sans-serif">
              testt
              <span style="font-family: Impact, Charcoal, sans-serif">
                testt
                <span style="font-family: Impact, Charcoal, sans-serif">
                  t
                  <span
                    style="font-family: Impact, Charcoal, sans-serif"
                    id="isPasted"
                  >
                    t
                    <span
                      style="font-family: Impact, Charcoal, sans-serif"
                      id="isPasted"
                    >
                      test
                      <span style="font-family: Impact, Charcoal, sans-serif">
                        test
                        <span
                          style="font-family: Impact, Charcoal, sans-serif"
                          id="isPasted"
                        >
                          test
                          <span style="font-family: Impact, Charcoal, sans-serif">
                            testt
                            <span style="font-family: Impact, Charcoal, sans-serif">
                              testt
                              <span
                                style="
																	font-family: Impact, Charcoal, sans-serif;
																"
                              >
                                test
                                <span
                                  style="
																		font-family: Impact, Charcoal, sans-serif;
																	"
                                >
                                  testtest
                                </span>
                                test
                              </span>
                              est
                            </span>
                            est
                          </span>
                          test
                        </span>
                        t
                        <span style="font-family: Impact, Charcoal, sans-serif">
                          testt
                          <span style="font-family: Impact, Charcoal, sans-serif">
                            test
                            <span style="font-family: Impact, Charcoal, sans-serif">
                              testtest
                            </span>
                            test
                          </span>
                          est
                        </span>
                        est
                      </span>
                      test
                    </span>
                    est
                    <span style="font-family: Impact, Charcoal, sans-serif">
                      testt
                      <span style="font-family: Impact, Charcoal, sans-serif">
                        testt
                        <span style="font-family: Impact, Charcoal, sans-serif">
                          test
                          <span style="font-family: Impact, Charcoal, sans-serif">
                            testtest
                          </span>
                          test
                        </span>
                        est
                      </span>
                      est
                    </span>
                    test
                  </span>
                  est
                  <span style="font-family: Impact, Charcoal, sans-serif">
                    testtest
                  </span>
                  test
                </span>
                est
              </span>
              est
            </span>
            test
          </span>
          ttest
        </span>
        test
      </span>
      est
    </span>
    est
  </span>
  test
</span>
Editor version.

If you don't know it, please see https://wysiwyg-editor.froala.help/hc/en-us/articles/360000717049-How-can-I-find-my-editor-version-.

  • v4.2.2 (latest version in froala.com webpage)
OS.

(OS name and version here)

  • Mac
Browser.

(Browser name an version here)

  • Chrome
Recording.

(A recording showing how to reproduce the problem)

froala-editor.mov
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

1 participant