Coder Social home page Coder Social logo

Comments (3)

mweiss avatar mweiss commented on May 30, 2024 1

That's cool that you solved your particular issue πŸ‘ , it seems like different versions of contenteditable handle newline characters in pre elements in different ways. I don't know your exact requirements, but you may also be able to avoid the issue in a similar way line break element instead of using a newline wrapped in a span.
I'll close this ticket for now. Thanks for reporting the issue!

from elm-rte-toolkit.

rjdellecese avatar rjdellecese commented on May 30, 2024

Actually, it seems to work in Firefox, but not in Safari or Chrome.

from elm-rte-toolkit.

rjdellecese avatar rjdellecese commented on May 30, 2024

I solved this by creating a new inline leaf node that is just an empty span containing a newline ("\n"). Here is an updated Ellie with the solution. This worked for me in Chrome, Firefox, and Safari.

I wonder if it would be better to make RichText.Commands.insertNewline work this way, too? If so, I would be happy to open a PR to do so!

I'll leave this open for the moment in case that would be useful, or else feel to close the issueβ€”my particular problem has been solved.

from elm-rte-toolkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.