MergeMyPullRequest / order-splitter

STABLE: https://mergemypullrequest.github.io/order-splitter/ BETA: https://jonsmithers.github.io/order-splitter/
MIT License
2 stars 0 forks source link

Fundamentally redesign parser #30

Closed jonsmithers closed 7 years ago

jonsmithers commented 7 years ago

I think the input/parser design is fundamentally limiting. When the user copies the orderup receipt and pastes it into our textarea, it gets transformed from html into plaintext, so we lose lots of useful information. Consequently, we're make the user enter sales tax, processing fee, and delivery fee manually.

We can just let the user paste html instead of plain text by using the contenteditable attribute on on a <div>. Then we'd have the html to work with. (Also, we could re-use the same parser in a "live preview" in the chrome-extension.)

tl;dr The parser should be html-based, not text-based.

dumbbillyhardy commented 7 years ago

How would they get the html though? I think they would have to enter dev tools on orderup, which would be a bad experience I feel.

jonsmithers commented 7 years ago

They've already been copying html this whole time. We just need to accept html instead of text.

If you copy anything on this webpage and paste it into word document, it'll paste as rich text or something. If you paste it into order splitter's <textarea> element, it'll paste as text. If you paste into a <div contenteditable="true"> element, it'll paste as html.

jonsmithers commented 7 years ago

Evernote.com uses content editable divs. See how I pasted html?

screen shot 2017-06-21 at 3 48 51 pm

dumbbillyhardy commented 7 years ago

WOAH! That's awesome! I'm sold.