News for hackers. Stuff that matters.
Re:If it is worth keeping, save it in Markdown by hakaneskici on Tuesday February 25, 2025 @08:31PM (#43179649)
Interesting. Why not HTML? Browsers have native basic WYSIWYG editing built in, and almost every screen we look at is nowadays HTML, including the code editor.

On a `<div contenteditable=true> element, calling document.execCommand('bold') will make selected text bold in WYSIWYG mode. See https://jsfiddle.net/z0umpb3x/12/ for the concept.

The main idea here is that I don't want to know any syntax like RTF, nor I want to use any tools.

Re:If it is worth keeping, save it in Markdown by inetknght on Tuesday February 25, 2025 @10:28PM (#43180284)
> Why not HTML? Browsers have native basic WYSIWYG editing built in

Can you point me to a page in Firefox that I can use offline to WYSIWYG edit a hypertext document without needing to use the developer console to edit raw HTML?

Re:If it is worth keeping, save it in Markdown by oneshtein on Tuesday February 25, 2025 @11:54PM (#43180765)
You can use this bookmarklet to create new pages:

  data:text/html,<html%20contenteditable>
then save them as HTML-files.

You can use another bookmarklet to turn existing pages or files into editable pages.

Re:If it is worth keeping, save it in Markdown by tyzoid on Wednesday February 26, 2025 @12:10AM (#43180845)
You can't easily take text and make it red that way, only edit the existing content.
Re:If it is worth keeping, save it in Markdown by account42 on Thursday February 27, 2025 @06:56AM (#43193517)
You can add another bookmarklet for that.
Re:If it is worth keeping, save it in Markdown by jenadine on Wednesday February 26, 2025 @01:41AM (#43181308)
If you want to do that offline, then you shouldn't use a browser but a HTML editor. There are plenty https://en.m.wikipedia.org/wiki/List_of_HTML_editors
Re:If it is worth keeping, save it in Markdown by hakaneskici on Wednesday February 26, 2025 @07:24PM (#43189927)
I believe it's technically possible, but I don't know if there's a tool.

Btw, genuinely asking, what's your offline scenario? Long loong time ago, I used TiddlyWiki for a brief time period for my temp offline scenarios. Single local HTML, can edit, but not WYSIWYG.

Re:If it is worth keeping, save it in Markdown by inetknght on Wednesday February 26, 2025 @11:01PM (#43191211)
> what's your offline scenario?

Keep my data out of corporate hands without needing to run a website myself (eg, a WYSIWYG site) while not having to use some different app.

Re:If it is worth keeping, save it in Markdown by dangus on Tuesday February 25, 2025 @08:43PM (#43179727)
I'm not the parent commenter but I'm going to guess because HTML is horrible at WYSIWYG.

If your editing tool changes or if your switch editors, they will all botch your HTML anywhere you make edits.

RTF is basically "it just works," very much like "Microsoft Word Light."

Re:If it is worth keeping, save it in Markdown by assimpleaspossi on Tuesday February 25, 2025 @09:12PM (#43179867)
Your complaint seems to be about the editors, not HTML.
Re:If it is worth keeping, save it in Markdown by pimlottc on Tuesday February 25, 2025 @11:02PM (#43180469)
Unless you're willing to write your own editor, that's not really a practical distinction
Re:If it is worth keeping, save it in Markdown by dangus on Saturday March 01, 2025 @09:47AM (#43219698)
Yes, my complaint is about the editors. But it's also a problem with HTML because with HTML you can implement a document that looks the same using multiple techniques, so editors will always have code generation differences.
Re:If it is worth keeping, save it in Markdown by hakaneskici on Tuesday February 25, 2025 @08:56PM (#43179793)
Makes sense. I was thinking that browsers have native support for WYSIWYG editing and most browsers/apps are Chromium based; so how the browser handles HTML formatting should be stable for a single person scenario even across apps.
Re:If it is worth keeping, save it in Markdown by oneeyedpigeon on Wednesday February 26, 2025 @05:31AM (#43182497)
HTML isn't "horrible" at WYSIWYG, it just isn't WYSIWYG. Your comment is like saying "JSON is horrible at for loops"—it's just a misunderstanding of the tool.
Re:If it is worth keeping, save it in Markdown by account42 on Thursday February 27, 2025 @06:58AM (#43193533)
HTML WYSIWYG editors are not going to create worse tag soup than WYSIWYG editors for other formats. If you care about how the precise HTML cod then WYSIWYG is the wrong tool.
Re:If it is worth keeping, save it in Markdown by lukeschlangen on Wednesday February 26, 2025 @08:48AM (#43183577)
I like this approach and I’m thinking I might agree. I’ve been starting with Markdown, but find myself going to HTML. At some point I end up wanting some specific thing that isn’t supported by Markdown so I need to leave Markdown for embedding a video or adding a tiny bit of interactivity (like show/hide), so sticking with HTML throughout is nice.
Re:If it is worth keeping, save it in Markdown by tengwar2 on Thursday February 27, 2025 @05:03PM (#43199030)
HTML would be a third alternative, yes. However historically it has been less stable in its definition, and also less stable in round-trip editing by a WYSIWYG editor - it has never been been an aim for HTML to be friendly to editing at that level. In contrast there are several editors which handle RTF without disrupting it for other editors. I use TextEdit (on the Mac), but of course it it is a common word processor format. RTFD is far less well supported, but I don't normally need images. I'm not familiar with any WYSIWYG editors for HTML which represent embedded images as though they were part of the same file.

> The main idea here is that I don't want to know any syntax like RTF

Nor do I. What I want is a file format which is long-term viable, and which I can edit in a WYSIWYG editor. The underlying file format being text-based useful as a recovery mechanism if RTF ever becomes unsupported, but it's not intended that one would edit it manually

> , nor I want to use any tools.

While I do not want to edit a file format manually.