danhper / atomic-chrome

Edit Chrome textareas in Atom
https://goo.gl/Et0hwg
MIT License
916 stars 30 forks source link

Special Handling for Workflowy: Part 1 #15

Closed drosenstark closed 8 years ago

drosenstark commented 8 years ago

Problem

When the text is pulled out of a notes field in Workflowy, it looks like this

1) one thing
2) another thing
3) a third thing

but when it returns to the contenteditable div, the text comes back like this:

<div>1) one thing</div><div>2) another thing</div><div>3) a third thing</div>

While this looks right, when Workflowy subsequently saves it, it strips out the HTML tags and therefore the line breaks.

Solution

I think this problem would be solved if the text came back in with the real line-breaks intact.

Notes

I realize that special handling for one site is hard to consider, but... perhaps it's useful for other sites too?

I have no affiliation with Workflowy, but I must note that it's a great tool and, more importantly for this, it's free to use quite extensively.

Anyway, thanks in advance for even considering this, and for this awesome plug-in/package!

[Note: This issue was edited using Atomic Chrome ;)]

danhper commented 8 years ago

@drosenstark Hi, thanks for reporting!

I added a special handler for workflowy which simply set the value to the current text instead of doing the usual conenteditable processing (which is needed for Gmail, for example).

I think this should fix your issue, but could you give it a try please before I publish to the Store? To do so, run the following commands

git clone https://github.com/tuvistavie/atomic-chrome.git
npm install
npm run build

then, remove the currently installed Atomic Chrome from Chrome and from the Manage extensions page, click on "Load unpacked extension" and select the app folder of this repository.

Thank you :smiley:

drosenstark commented 8 years ago

Okay, testing now, thanks...

drosenstark commented 8 years ago

[I had to install Node for this... first time for everything]

It works perfectly... thank you so much for doing this. This is a huge game changer for me!

danhper commented 8 years ago

Thanks for trying it out! I'll publish a new version to the store then!

danhper commented 8 years ago

0.2.5 should be available on the store within a few hours, thanks for the help :smile:

drosenstark commented 8 years ago

Thank you so much. Awesome stuff!

Looking forward to trying the production version.

Note: so far this new version appears to be working well with this repo by @ryanpcmcquen

drosenstark commented 8 years ago

Um... maybe I spoke too soon on the cooperation with @ryanpcmcquen's repo. It kind of depends when you click where. HHmmmm....

danhper commented 8 years ago

After checking, it seems workflowy creates a contenteditable div per bullet point, is this is why you are having trouble? If this is the issue, I think it is going to be rather complicated to get something working, as this is quite an edge case. If you want to try to work on it, I am of course open to PRs!

drosenstark commented 8 years ago

Sorry Daniel, didn't see your comment here. No, the issue with @ryanpcmcquen's stuff is not a problem with Atomic Chrome (though it could be solved there). Ryan's plugin modifies the contents of the contenteditable div for view only, which WF will overwrite on keydown.

So if the user hits a keydown and THEN hits the Atomic Chrome button, all is good. If the user hits the Atomic Chrome button before that, it gets the modified node.

In Summary

I think we're very good on Workflowy support for now. I'm ecstatic to have it and I think it's great. Thank you!

danhper commented 8 years ago

Hi, Dan, Great, I am very happy it seems to be working fine for you. Please feel free to reopen an issue if you find anything else that could be done better.