• Re: Markup in mail messages

    From eben@gmx.us@21:1/5 to Max Nikulin on Wed May 15 05:40:01 2024
    On 5/14/24 22:17, Max Nikulin wrote:
    On 15/05/2024 02:32, Greg Wooledge wrote:
    On Tue, May 14, 2024 at 08:16:20PM +0200, Nicolas George wrote:
    Messages in Markdown in the Windows world? I have never seen it.
    [...]
    The only sensible interpretation I can
    come up with for why these asterisks were added is that they're being
    placed around text that's supposed to be emphasized/italicized.

    *Bold*, /italics/, and _underlined_ markup is supported by various
    mailers, e.g. Thunderbird and Gnus. Some render superscripts^1 and subscripts_2 as well.

    Backticks (`echo $PATH`) are more specific to markdown. However
    sometimes I use them not expecting that the message will be rendered as markdown. Just to avoid ambiguity where a piece of code starts and ends.

    If your mail path is sufficiently modern, you might be able to use Unicode subscripts₁ and superscripts². But, they're kind of a pain to type for >1 character.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Darac Marjal@21:1/5 to All on Wed May 15 17:00:01 2024
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------LcU9h2iZRDdIt5QNYL2K6d4a
    Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64

    T24gMTUvMDUvMjAyNCAwMzoxNywgTWF4IE5pa3VsaW4gd3JvdGU6DQo+IE9uIDE1LzA1LzIw MjQgMDI6MzIsIEdyZWcgV29vbGVkZ2Ugd3JvdGU6DQo+PiBPbiBUdWUsIE1heSAxNCwgMjAy NCBhdCAwODoxNjoyMFBNICswMjAwLCBOaWNvbGFzIEdlb3JnZSB3cm90ZToNCj4+PiBNZXNz YWdlcyBpbiBNYXJrZG93biBpbiB0aGUgV2luZG93cyB3b3JsZD8gSSBoYXZlIG5ldmVyIHNl ZW4gaXQuDQo+IFsuLi5dDQo+PiBUaGUgb25seSBzZW5zaWJsZSBpbnRlcnByZXRhdGlvbiBJ IGNhbg0KPj4gY29tZSB1cCB3aXRoIGZvciB3aHkgdGhlc2UgYXN0ZXJpc2tzIHdl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8UANDIdbq6FeCfiqIB6dUlWhdIJ fgZX4X1eFeF380pk5InCwSfyU+kTb9vIS9M+atd1cmjyADEFAU8LTOuhRQaRCPmfL8m7TOMB0+pp UwI=
    =q0nc
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David@21:1/5 to Darac Marjal on Wed May 15 20:50:01 2024
    On Wed, 2024-05-15 at 15:57 +0100, Darac Marjal wrote:
    On 15/05/2024 03:17, Max Nikulin wrote:

    On 15/05/2024 02:32, Greg Wooledge wrote:

    On Tue, May 14, 2024 at 08:16:20PM +0200, Nicolas George wrote:

    Messages in Markdown in the Windows world? I have never seen it.


    [...]

    The only sensible interpretation I can
    come up with for why these asterisks were added is that they're being placed around text that's supposed to be emphasized/italicized.


    *Bold*, /italics/, and _underlined_ markup is supported by various
    mailers, e.g. Thunderbird and Gnus. Some render superscripts^1 and subscripts_2 as well.

    Backticks (`echo $PATH`) are more specific to markdown. However
    sometimes I use them not expecting that the message will be rendered as markdown. Just to avoid ambiguity where a piece of code starts and ends.


    When this sort of subject comes up (as it does, every so often), I
    wonder why `text/markdown` isn't offered as a mime type for sending
    emails. If you're an MUA and you're going to parse text/plain for
    markup, then why not offer text/markdown as the body of the message? I
    know that there have been various attempts to bridge the gap between "text/plain is too basic" and "text/html is too powerful" such as text/enriched and text/rtf, but Markdown seems to be hitting a sweet
    spot of being easy to write and being widely adopted elsewhere.

    Evolution delivers on a markdown option.\
    Cheers!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Monnier@21:1/5 to All on Thu May 16 15:30:01 2024
    When this sort of subject comes up (as it does, every so often), I wonder
    why `text/markdown` isn't offered as a mime type for sending emails.

    FWIW, last time I tried to send `text/(x-)markdown` messages,
    I discovered that many "popular" MUAs do not display those at all (they
    treat them as attachments, for example), contrary to what the RFCs say
    they SHOULD do. 🙁

    So, yes, I encourage you to send more of those, and if your recipients
    don't like the result, try and get them to complain to their
    MUA's authors (most of those MUAs are of course proprietary and are not
    very ... responsive, but that's all we can do).

    The stupidest case I bumped into is Github where replying by `plain/text`
    email lets you add comments to an issue, but `text/markdown` replies are
    simply sent to `/dev/null` even though Markdown is the standard format
    they use in the web interface.


    Stefan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Henning Follmann@21:1/5 to tomas@tuxteam.de on Thu May 16 16:00:01 2024
    On Thu, May 16, 2024 at 03:47:48PM +0200, tomas@tuxteam.de wrote:
    On Thu, May 16, 2024 at 09:28:05AM -0400, Stefan Monnier wrote:

    [...]

    So, yes, I encourage you to send more of those, and if your recipients don't like the result, try and get them to complain to their
    MUA's authors (most of those MUAs are of course proprietary and are not very ... responsive, but that's all we can do).

    Actually I've been tempted to teach my mail reader to transform HTML
    into some lightweight markup (yeah, you need a bit of heuristics for
    that ;-) -- say Org, but why not its poor sister Markdown.

    [...]
    Please don't settle for markdown. I would love a org filter!
    org-mode just handles tabular data admirably :)

    -H





    --
    Henning Follmann | hfollmann@itcfollmann.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From tomas@tuxteam.de@21:1/5 to Stefan Monnier on Thu May 16 15:50:01 2024
    On Thu, May 16, 2024 at 09:28:05AM -0400, Stefan Monnier wrote:

    [...]

    So, yes, I encourage you to send more of those, and if your recipients
    don't like the result, try and get them to complain to their
    MUA's authors (most of those MUAs are of course proprietary and are not
    very ... responsive, but that's all we can do).

    Actually I've been tempted to teach my mail reader to transform HTML
    into some lightweight markup (yeah, you need a bit of heuristics for
    that ;-) -- say Org, but why not its poor sister Markdown.

    The stupidest case I bumped into is Github where replying by `plain/text` email lets you add comments to an issue, but `text/markdown` replies are simply sent to `/dev/null` even though Markdown is the standard format
    they use in the web interface.

    What'd you expect from Microsoft? -- Excelllllence!1!!

    Cheers
    --
    t

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZkYOfgAKCRAFyCz1etHa RhCEAJ9IKR8x/Oahq0gvJmCk9nsFti5BgwCcDW3Qf91LmlX65HR9bZMuLRaEdeE=
    =ilTB
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Curt@21:1/5 to Stefan Monnier on Thu May 16 17:10:02 2024
    On 2024-05-16, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
    When this sort of subject comes up (as it does, every so often), I wonder
    why `text/markdown` isn't offered as a mime type for sending emails.

    FWIW, last time I tried to send `text/(x-)markdown` messages,

    Attribute quotes accurately.

    https://wiki.debian.org/DebianMailingLists#Posting_Rules.2C_Guidelines.2C_and_Tips

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Karl Vogel@21:1/5 to All on Fri May 17 05:50:01 2024
    On Thu, May 16, 2024 at 09:48:23AM -0400, tomas@tuxteam.de wrote:

    Actually I've been tempted to teach my mail reader to transform HTML
    into some lightweight markup (yeah, you need a bit of heuristics for
    that ;-) -- say Org, but why not its poor sister Markdown.

    https://github.com/aaronsw/html2text/ might interest you. It converts
    (relatively) sane HTML into Markdown.

    I put html2text.py into $HOME/lib and use this to call it:

    #!/bin/sh
    #<html2mkd: convert reasonable HTML to Markdown
    exec /usr/bin/env python $HOME/lib/html2text.py ${1+"$@"}
    exit 1

    --
    Karl Vogel I don't speak for anyone but myself

    Getting old has advantages. I can hide my own Easter Eggs, and young
    ladies giggle when I give someone the finger.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Max Nikulin on Fri May 17 13:20:01 2024
    On Fri, May 17, 2024 at 12:43:49PM +0700, Max Nikulin wrote:
    On 17/05/2024 10:16, Karl Vogel wrote:
    https://github.com/aaronsw/html2text/ might interest you. It converts
    (relatively) sane HTML into Markdown.

    I put html2text.py into $HOME/lib and use this to call it:

    #!/bin/sh
    #<html2mkd: convert reasonable HTML to Markdown
    exec /usr/bin/env python $HOME/lib/html2text.py ${1+"$@"}
    exit 1

    I am puzzled by this wrapper. I expect that "$@" is enough here and namely {1+"$@"} is redundant. Am I wrong?

    https://mywiki.wooledge.org/WrapperScript

    Short version: "$@" is good enough if your /bin/sh isn't museum-era.
    ${1+"$@"} works around a bug in some very old shells.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Monnier@21:1/5 to All on Fri May 17 21:30:01 2024
    Actually I've been tempted to teach my mail reader to transform HTML
    into some lightweight markup (yeah, you need a bit of heuristics for
    that ;-) -- say Org, but why not its poor sister Markdown.
    Please don't settle for markdown. I would love a org filter!
    org-mode just handles tabular data admirably :)

    Just beware that Org's code is generally written under the implicit
    assumption that the Org document is trusted, so if you try to reuse
    parts of Org's code to do the rendering be extra mindful of the
    potential for security holes.
    [ This applies to many other ELisp packages, of course; it's not
    exclusive to Org. ]


    Stefan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Henning Follmann@21:1/5 to Stefan Monnier on Fri May 17 23:20:01 2024
    On Fri, May 17, 2024 at 03:25:49PM -0400, Stefan Monnier wrote:
    Actually I've been tempted to teach my mail reader to transform HTML
    into some lightweight markup (yeah, you need a bit of heuristics for
    that ;-) -- say Org, but why not its poor sister Markdown.
    Please don't settle for markdown. I would love a org filter!
    org-mode just handles tabular data admirably :)

    Just beware that Org's code is generally written under the implicit assumption that the Org document is trusted, so if you try to reuse
    parts of Org's code to do the rendering be extra mindful of the
    potential for security holes.
    [ This applies to many other ELisp packages, of course; it's not
    exclusive to Org. ]


    Very true,
    but most content is unsafe like office (MS and open), PDF any other than
    PDF-A. And HTML which can include JS.
    org-mode can execute also other code than lisp, like python, JS, Lua

    A filter though could be limited to only create safe org markup.

    -H


    --
    Henning Follmann | hfollmann@itcfollmann.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From tomas@tuxteam.de@21:1/5 to Stefan Monnier on Sat May 18 07:50:01 2024
    On Fri, May 17, 2024 at 03:25:49PM -0400, Stefan Monnier wrote:
    Actually I've been tempted to teach my mail reader to transform HTML
    into some lightweight markup (yeah, you need a bit of heuristics for
    that ;-) -- say Org, but why not its poor sister Markdown.
    Please don't settle for markdown. I would love a org filter!
    org-mode just handles tabular data admirably :)

    Just beware that Org's code is generally written under the implicit assumption that the Org document is trusted, so if you try to reuse
    parts of Org's code to do the rendering be extra mindful of the
    potential for security holes.

    My tip of the hat towards Org was somewhat tongue-in-cheek. The
    problem I actually see with Org (and with Markdown, to a lesser
    extent) is that they are pretty ad-hocish and tinker friendly.

    Which is a *big* plus on the one hand.

    On the other, though, once you want to formalize the thing (a
    prerequisite to be able to even start talking about security),
    a myriad of dialects has evolved.

    Then you either need a dictatorship (Github aka Microsoft, cf.
    "github flavoured Markdown") or you have a long and painful
    process (Org is trying, currently).

    The upside of Org and Markdown is that you (currently, at least)
    don't need a special reader to make sense of them.

    But (that's the fourth or fifth hand?) if you follow the evolution
    of HTML, back then (TM) you didn't need a special reader either.
    Looking at the crud generated by e.g. "modern" Microsoft mailers,
    though...

    There's room for information technology sociologists here :)

    Cheers
    --
    t

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZkg/2gAKCRAFyCz1etHa Rt43AJ9k0Q1D+mrifS2chMJBceg1IKWgOACfSLrGFwyuWMgQNr8i5Bp+1ydsyV0=
    =a/MQ
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Max Nikulin on Sat May 18 15:50:01 2024
    On Sat, May 18, 2024 at 08:26:55PM +0700, Max Nikulin wrote:
    On 17/05/2024 18:10, Greg Wooledge wrote:
    On 17/05/2024 10:16, Karl Vogel wrote:
    https://github.com/aaronsw/html2text/ might interest you. It converts
    (relatively) sane HTML into Markdown.

    I put html2text.py into $HOME/lib and use this to call it:

    #!/bin/sh
    #<html2mkd: convert reasonable HTML to Markdown
    exec /usr/bin/env python $HOME/lib/html2text.py ${1+"$@"}
    exit 1
    [...]
    https://mywiki.wooledge.org/WrapperScript

    Short version: "$@" is good enough if your /bin/sh isn't museum-era. ${1+"$@"} works around a bug in some very old shells.

    Thanks. I am unsure if a python2 script from 2011 is consistent with a sh expanding "$@" to empty string, but the reason of the construct might be
    just muscle memory or some guide.

    It has nothing to do with the program being exec-ed. The bug is in the
    old implementations of /bin/sh. If you're on Debian, you don't need to
    worry about it. There is *no* version of Debian which has a /bin/sh
    which has this bug. Only legacy commercial Unix systems have it.

    P.S.
    Portable shell section in autoconf manual mentions "${1+"$@"}" issues with zsh (the script above requires /bin/sh explicitly): https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/autoconf.html#index-_0022_0024_0040_0022

    *sigh* zsh....

    Well, once again, there is no version of Debian that uses zsh as its
    /bin/sh, so you should be OK here. But if you really want to use the
    case $# workaround, I won't say you're wrong.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)