GithubHelp home page GithubHelp logo

Comments (12)

kalin avatar kalin commented on August 17, 2024

This is also amongst my biggest frustrations when I moved from gmail to fastmail. I find I have to cut and paste-without-formatting (cmd-option-shift-V) every day just to clean up format soup in email drafts.

from squire.

neilj avatar neilj commented on August 17, 2024

Yep, I'd be interested in adding this to Squire (and FastMail) I think. The question is does it just clear inline formatting, or also block level formatting (changing h1,p -> div etc.)?

from squire.

AmadeusW avatar AmadeusW commented on August 17, 2024

That's a good question. I'd expect it to clear all kinds of formatting.

from squire.

AntonTrollback avatar AntonTrollback commented on August 17, 2024

+1

clear inline formatting, or also block level formatting

Both, two options <3

from squire.

mickdekkers avatar mickdekkers commented on August 17, 2024

+1

from squire.

carsol avatar carsol commented on August 17, 2024

+1 :)

from squire.

gertsonderby avatar gertsonderby commented on August 17, 2024

+1 from us at One.com too. We're evaluating Squire for our webmail application, and need this feature.

from squire.

crossjs avatar crossjs commented on August 17, 2024

like tinymce:
just clear style and class attribute.

from squire.

neilj avatar neilj commented on August 17, 2024

If you just clear the attributes, that will have no impact on <i> or <b> tags adding inline formatting.

from squire.

gertsonderby avatar gertsonderby commented on August 17, 2024

I've been considering ways to do this. Removing all tags beyond a short whitelist (P, BR, DIV? Others?) in the selected range should do the trick marvelously, possibly adding clearing style tags in the range. But the functionality for removing styling that I've seen is more targeted toward removing a specific list of tags. Not sure yet how to solve it, but definitely up for trying - though my schedule is pretty packed right now. Doubt I'll be able to crack into it before June rolls around.

from squire.

neilj avatar neilj commented on August 17, 2024

My suggestion would be to remove all nodes in the selection for which isInline ( node ) && !isLeaf( node ). You obviously need to split the start/end if the selection is midway through such tags.

That should clear inline formatting. To clear block formatting as well, I would probably use the getNextBlock fn to iterate through all blocks in the selection and dump their contents into a new defaultBlockTag node, then remove the current content and replace it with the new nodes.

from squire.

neilj avatar neilj commented on August 17, 2024

Implemented (thanks @gertsonderby!) and merged into the master branch. There is now a new removeAllFormatting method.

from squire.

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.