Live data from Hacker News

Show HN: Nash, I made a standalone note with single HTML file

keepworking.github.io

131–140 of 153 posts

Re: Show HN: Nash, I made a standalone note with single HTML file

#132

Earlier quoted context omitted.

really, just like we had a "you don't need jquery for that" we need a "you don't need react (or vue, or svelte, or whatever else you are thinking) for that." plain, vanilla js and some decent skills will do nearly almost everything in a cleaner and more maintainable way. after decades of maintaining other people's stuff, dumb design by smart people beats all the other combinations.

The downside, of course, is needing to code in JavaScript.

Just learn it right. I'm tired of people fighting it because they think they can learn it by intuition and then create monstrosities that are easily solved by the language they refused to understand properly in the first place.

Re: Show HN: Nash, I made a standalone note with single HTML file

#136
post #59

Much of the heavy lifting is done by this simple but powerful attribute, something surprisingly few developers seem to know about. It's been around for quite a while.

This one line was like 90% of the original implementation of Writely (the startup that became Google Docs; source: I was one of the founders). The other 90% was all the backend code we had to write to properly synchronize edits across different browsers, each with their own bizarre suite of bugs in their contenteditable implementations :-)

I thought it was a dynamic text box souped up with all sorts of tricks and semantics to make it appear like a rich text editor

Re: Show HN: Nash, I made a standalone note with single HTML file

#138

Earlier quoted context omitted.

This one line was like 90% of the original implementation of Writely (the startup that became Google Docs; source: I was one of the founders). The other 90% was all the backend code we had to write to properly synchronize edits across different browsers, each with their own bizarre suite of bugs in their contenteditable implementations :-)

I thought it was a dynamic text box souped up with all sorts of tricks and semantics to make it appear like a rich text editor

I'm not sure exactly what you mean by "dynamic text box" but it was just a contenteditable div. There have been at least two complete rewrites since I was involved, nowadays I believe it's a canvas with all of the editing, formatting, layout, and rendering done "by hand" in JavaScript.

Re: Show HN: Nash, I made a standalone note with single HTML file

#139
I've done a similar tool a few years ago, with "contenteditable". It's great. Especially for non-tech people who want to quickly edit articles on a website. (that was an experiment).

The problem I had: when people copy/paste HTML from external sources, after a few edits, a few months later, you see that the HTML is just a horrible mix of various mixed up tags, the structure is lost, you have

    

everywhere and it's impossible to clean it in WYSIWYG.

OP, did you find a satisfying solution to this problem? A good compromise for sanitizing of copy/paste content? TL;DR: not remove the images, but clean the

    
stuff when copy/pasting?
Post reply on HN