Giter Club home page Giter Club logo

Comments (8)

subnut avatar subnut commented on August 10, 2024 2

Select Plain text mode in gmail. Problem solved!

https://useplaintext.email/#gmail-web

from ghosttext.

luisherranz avatar luisherranz commented on August 10, 2024 1

I have started playing with this in my site-transformations branch in case anyone else wants to try.

main...luisherranz:site-transformations

For the HTML<->Markdown transformation I'm using unified (remark/rehype).

The goal is not to get only HTML<->markdown but also a way to do other replacements, because sites that use HTML don't play 100% well with the plain markdown converters. For example, the markdown quote (> Text) is not being transformed to the Gmail HTML quote, which means that we also need to do some replacement with RegExp.

Even sites that use Markdown, like Slack (with markdown turned on), need other replacements, like for example turning Slack's bold text (*bold*) into markdown bold text (**bold**) and vice-versa.

Finally, this type of site transformations/integrations, if ever accepted by @fregante, probably need either:

  • Some kind of code-splitting (probably using dynamic import()'s) so the required for a site is only loaded when loading that site.
  • A user interface to configure RegExp replacements and activate HTML<->Markdown conversion per site, so hardcoded site transformations are not needed.

Anyway, it's too soon for that, for now, I'm just going to explore what type of transformations are needed for the different sites. If anyone else wants to work on this, please send a PR with your transformations/replacements in my fork, with site-transformations as the base branch.

from ghosttext.

fregante avatar fregante commented on August 10, 2024 1

You raise good points, this transformation is going to be lossy and likely a complex feature:

  • when a contentEditable field is selected, the user should be asked:
    • HTML
    • plain text (flatten to .innerText)
    • markdown
  • even before sending, the original content will be irrevocably lost if the user picks txt or md
  • we probably don't want to support anything but Markdown, this already requires a large library and substantial effort to implement, let alone if we were to offer custom replacements with options. Definitely no to that part.

from ghosttext.

Cacodaimon avatar Cacodaimon commented on August 10, 2024

It might be possible, but I would try to build a more general way with custom filters.

But I would need some time finding a way implementing custom filters.

from ghosttext.

fregante avatar fregante commented on August 10, 2024

We might want to keep this in the browser part so it can be easily shared.

Edit: maybe not for size reasons

from ghosttext.

gruns avatar gruns commented on August 10, 2024

Any progress on this front? Or best practices to use GhostText to compose emails
in Gmail?

from ghosttext.

gruns avatar gruns commented on August 10, 2024

Bump -- Gmail compose windows remain ungainly HTML. Any progress on this
front?

from ghosttext.

albert-ying avatar albert-ying commented on August 10, 2024

Select Plain text mode in gmail. Problem solved!

https://useplaintext.email/#gmail-web

@subnut Hmmm, I tried to set my Gmail to plain text mode. The decorative elements are removed. However, it still sorts of HTML formatted and requires the <div> tag to start a new line.

from ghosttext.

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.