Markdown or HTML ? #148
Replies: 2 comments 1 reply
-
I still think markdown is a styled-description not plain text, but it may be complex to implement and the lack of discussion on this probably means that those who use markdown don't share their work with those who don't understand it so everyone is happy to simply use the description field as they see fit. |
Beta Was this translation helpful? Give feedback.
-
I write here not as a programmer - I don't know much about that. What I want to mention here is some everyday work experience in a small office and what happens if you allow any html in text fields: When we transitioned some years ago from sending our customers pdf files with product information to let them view everything on the web I encountered strange formatting on my webpage displaying text. The information on the webpage was entered by my colleagues in fields with editors that converted the field to html but allowed the user to format bold / italic / ... Sometimes the input on the webpage just looked weired. Why? Because people are people and are lazy: Sometimes they copied and pasted the text from their text processing software on the desktop directly into the text fields while editing the web page. Some users didn't know the difference between copying plain text and html formatted text. And you would not believe how much formatting was in the text done by the desktop software. Which was allowed by the editor because they were considered "harmless" tags, e.g. After having too many discussions about how to correctly copy & paste text (without html as plain text) I changed the field type on my webpage from formatted html text to markdown with a markdown editor that allowed only few html tags and attributes. I write this because I think you will encounter the same problem in the long run. You will have to take care of all the possible html formatting that might be allowed / forbidden in any pasted text. Or sooner or later this will be visible on the display (e.g. if there is a future nextcloud desktop app for displaying these calendar notes). I see the future of jtx board in a "replacement" of evernote (without the attachment of big files which can be linked). But the more people are using it the more you will have to deal with people who don't understand what the are doing. Sorry for the long input. BTW: thanks for jtx board |
Beta Was this translation helpful? Give feedback.
-
re Markdown or not #323
Originally from https://gitlab.com/techbeeat1/jtx/-/issues/439 by @rogercreagh
I remain of the opinion that markdown should not be used in the plain description field as it is confusing to viewers who don't know markdown, and ugly to people who do know markdown.
Markdown lists work ok in plain text but it is mostly the bold, italic, and heading formats that are disturbing - plus more abstruse and complicated things like tables etc.
Less of an issue for Journals currently as there are few applications out there yet, but the same applies to ToDos and Memos/Notes.
I previously mentioned X-ALT-DESC as an alternative field but this is a bit specific to Microsoft (they use it for HTML in Outlook calendar entries), but I have subsequently discovered that RFC9073 updated RFC5545 to include a STYLED-DESCRIPTION property.
Extracts:
...
...
My feeling is that if markdown is to be included in the description then it should go in a separate STYLED-DESCRIPTION property and for backwards compatibility a plain text version (without markdown formatting) should be provided in DESCRIPTION.
This also opens the option of providing HTML in the STYLED-DESCRIPTION which may actually be more flexible as Markdown->HTML conversion is fairly simple (there are library functions for it) but the reverse is not true (HTML->Markdown).
Either way there is a property FMTTYPE which can be applied to STYLED-DESCRIPTION. Its default value if absent is
text/html
, but it could be set totext/markdown
if it was desired to use styled description simply for markdown formatted text.I don't think FMTTYPE is a recognised property for the DESCRIPTION in the rfc5545 spec.
In any event in the discussion below about sync'ing STYLED-DESCRIPTION the FMTTYPE should always be checked to determine what the remote system may have used - you might find a different system converts markdown in STYLED-DESCRIPTION to html.
So one way forward would be to allow Markdown when editing but immediately convert it to HTML and save it in STYLED-DESCRIPTION. Produce a plain text version from either the original markdown or the HTML (use
strip_tags();
or equivalent in the source language) an put it in the DESCRIPTION.An alternative would be to use
FMTTTYPE=text/markdown
for styled description, and save a markdown stripped version in the DESCRIPTIONWhen reading a sync'd entry if the date of the remote is newer than the local then there are there are a number of possibilities...
It is a new entry with no local version to update and no styled-description
it is a new entry with STYLED-DESCRIPTION present
it is an existing entry being updated by the remote and there is no styled-description present
<p>...</p>
tagsit is an existing entry with a styled description element present. In this case it is possible that the remote system has updated the description but ignored the styled-description. So we need to test if both remote elements match our local ones.
Sorry for the long post, but I hope the discussion is useful.I do think continuing with putting formatted text of any type (including markdown) in the DESCRIPTION is dangerous and not in line with the spec.
2 votes ·
Beta Was this translation helpful? Give feedback.
All reactions