wasavi icon indicating copy to clipboard operation
wasavi copied to clipboard

Ignore certain HTML elements? E.g: writing an email in Gmail and ignore signature

Open stianeklund opened this issue 9 years ago • 6 comments

Is it possible to allow wasavi to edit certain fields but ignore HTML elements? For example, if I use wasavi to compose an email it will strip the picture from my signature, ideally I'd like to be able to edit text and simply ignore HTML elements.

Edit: Might be already possible, ref: https://github.com/akahuku/wasavi/issues/96

stianeklund avatar Feb 19 '16 15:02 stianeklund

Same problem here. I tried with #96 but without result

crivotz avatar Feb 29 '16 12:02 crivotz

I might have misunderstood how it works, I can't get it to ignore certain elements that I want to use Wasavi with. It flat out either doesn't let me edit it, or spits out plaintext back if I write and save.

Please let me know if this could be a possible feature.

stianeklund avatar Mar 15 '16 07:03 stianeklund

First, wasavi is just a plain text editor. So I have no ideas that make wasavi be able to edit a HTML element. Therefore I considered one solution:

  1. Treat some elements (a, img, object, embed...) as special
  2. Give an ID to these elements (If an element has the ID originally, just use it)
  3. Generate plain text.
    • a element -> "<wasavi:a id='temporarily-id'>content</wasavi:a>"
    • img, object, embed element -> "<wasavi:img id='temporarily-id'/>", "<wasavi:object ... />", "<wasavi:embed ... />"
  4. Edit in wasavi
  5. When rewriting a text in a target element, wasavi rebuilds a rich text from plain text. About these special element, wasavi reuses each original element which corresponds to the ID

When you don't edit these special <wasavi:xxx> tags, that will be ignored consequently. How does that look?

akahuku avatar Mar 21 '16 21:03 akahuku

About editing content editable element including gmail, a little change was brought to wasavi 0.6.635 (wiki document). However whether this change is practical or not, I do not still uncertain. I want to hear a variety of opinions.

akahuku avatar Apr 07 '16 11:04 akahuku

@akahuku Your changes work wonderfully for me, my HTML signature remains, will have to test it a bit but so far it's very promising! Thank you!

stianeklund avatar Apr 28 '16 12:04 stianeklund

Hi @akahuku

This markdown evolution seems introduce this bug #134 who affect some people. I'll tried to find the cause when I have little bit of times.

prestancedesign avatar Jun 27 '16 14:06 prestancedesign