atomic-chrome icon indicating copy to clipboard operation
atomic-chrome copied to clipboard

Special Handling for Workflowy: Part 3

Open drosenstark opened this issue 8 years ago • 6 comments

Please see Other Workflowy Related Issues

Description of Problem

In Workflowy's editor for notes it wraps links, bold, italics and underline.

  • Links - Links are like this <a class="contentLink" target="_blank" rel="noreferrer" href="[SITE]">[SITE]</a>... those links then get converted to text in Atomic Chrome. They then return and get wrapped again... and so on and so on.
  • Formatting - Bold is like this <span class="contentBold">, while italics use contentItalics and underline uses contentUnderline<BR><BR>Multiple formats are delimited with spaces in the class attribute, e.g., class="contentItalic contentUnderline" (as you would expect from CSS)

Solutions

All of these tags should be removed on extraction to Atom.

I'm not sure this is specific for Workflowy. Any app that loads the contentEditable with HTML should have it expunged when it's moved to Atom, I think.

drosenstark avatar Jun 02 '16 14:06 drosenstark

Note from the author: there is this class for special Workflowy handling, in case someone wanted to fork:

https://github.com/tuvistavie/atomic-chrome/blob/master/src/content-script-tools/custom-events/workflowy.js

drosenstark avatar Jun 06 '16 18:06 drosenstark

@drosenstark Hi, sorry this took so long! I removed the tags when the text is extracted from Workflowy to Atom. I tried it and it seems to work fine with link, as the links are readded after, but the bold and italic formatting will I think be lost. Could you give the master branch a try and tell me how it goes please? Thank you :smile:

danhper avatar Jun 22 '16 10:06 danhper

Testing using instructions here

drosenstark avatar Jun 22 '16 14:06 drosenstark

Hey Daniel, thanks so much for doing this. Results:

  1. Links are perfect
  2. Bold/Italics are getting replaced with new-lines, which changes the content

Thanks! Dan

drosenstark avatar Jun 22 '16 14:06 drosenstark

On the other hand, #2 is not a showstopper, so I'd say to go ahead and push master if it's not easy to fix #2. This is already way better and resolves all the HUGE problems with recursion.

Thank you!

drosenstark avatar Jun 22 '16 19:06 drosenstark

I see it now... it's a peculiarity of Workflowy that it puts a \n before and after any formatting. I'd say that we're good to go and publish these changes... they're very helpful and remove all of the true risks. Great work and thanks for your kind attention!

drosenstark avatar Jun 22 '16 19:06 drosenstark