www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Rich text formatting is now available on forum.dlang.org

reply Vladimir Panteleev <thecybershadow.lists gmail.com> writes:
(This post best viewed on 
[forum.dlang.org](https://forum.dlang.org/)!)

Greetings esteemed forum users,

I am delighted to announce that as of today, you can use rich 
text formatting in forum.dlang.org messages.

This should help make code samples more readable, format tabular 
information as actual tables, but also add *subtle* or **strong** 
emphasis to your posts and hopefully improve how we communicate 
with our fellow netizens.

I have deliberated for a bit on which markup syntax to use—but, 
all things considered, there is really only one answer. There 
already exists an elegant and well-established markup language 
that members of our community are well familiar with, which is 
what has been implemented today. I am, of course, talking about 
DDoc!

To get you started, here is a primer:

- `$(B bold text)` → **bold text**
- `$(I italic text)` → *italic text*
- `$(D inline code)` → `inline code`
- `$(LINK https://dlang.org/)` → https://dlang.org/
- `$(LINK2 https://dlang.org/, The Best Programming Language)` → 
[The Best Programming Language](https://dlang.org/)
- Need to escape a special character? `$(DOLLAR)`, `$(LPAREN)` 
and `$(RPAREN)` are there and do exactly what they say.

Inline code blocks are easy:

     ---
     import std.stdio;
     void main() { writeln("Hello, world!"); }
     ---

becomes:

```d
import std.stdio;
void main() { writeln("Hello, world!"); }
```

Tables are even easier:

     $(TABLE $(TR $(TH Year) $(TH D users))
     $(TR $(TD 2010) $(TD 10,000))
     $(TR $(TD 2020) $(TD 100,000))
     $(TR $(TD 2030) $(TD 1,000,000)))

becomes:

| Year | D users |
|------|---------|
| 2010 | 10,000  |
| 2020 | 100,000 |
| 2030 | 1,000,000 |

And if the above is not sufficient to express your intent, there 
is the nuclear option: `$(SCRIPT ...)`, which allows embedding 
arbitrary JavaScript to format your post in however way you 
desire. jQuery is preloaded, so go nuts!

If you are not using the forum.dlang.org web interface, no 
worries—messages will still come through to you in good old plain 
text. And, if you're not a fan, you are in control: you can 
disable DDoc formatting in the posting form, or completely 
disable DDoc rendering on [the settings 
page](https://forum.dlang.org/settings).

Happy DDoc-ing!

— Vladimir
Apr 01
next sibling parent reply Kagamin <spam here.lot> writes:
On Thursday, 1 April 2021 at 07:27:38 UTC, Vladimir Panteleev 
wrote:
 And if the above is not sufficient to express your intent, 
 there is the nuclear option: `$(SCRIPT ...)`, which allows 
 embedding arbitrary JavaScript to format your post in however 
 way you desire. jQuery is preloaded, so go nuts!
Ermm... what?
Apr 01
next sibling parent Kagamin <spam here.lot> writes:
Ah, got it, lol.
Apr 01
prev sibling next sibling parent TheGag96 <thegag96 gmail.com> writes:
On Thursday, 1 April 2021 at 07:35:07 UTC, Kagamin wrote:
 On Thursday, 1 April 2021 at 07:27:38 UTC, Vladimir Panteleev 
 wrote:
 And if the above is not sufficient to express your intent, 
 there is the nuclear option: `$(SCRIPT ...)`, which allows 
 embedding arbitrary JavaScript to format your post in however 
 way you desire. jQuery is preloaded, so go nuts!
Ermm... what?
Right, this does NOT seem like a good idea... All the other improvements are **of course** welcome, though.
Apr 01
prev sibling parent reply destructive tester <dtester example.com> writes:
```
---
import std.stdio;
void main() { writeln("Hello, world!"); }
---
```

Gives this:

---
import std.stdio;
void main() { writeln("Hello, world!"); }
---

It's the triple backtick char ``` not the triple dash --- for 
fixed width chars.
Apr 01
parent destructive tester <dtester example.com> writes:
```
 It's the triple backtick char ``` not the triple dash --- for 
 fixed width chars.
Second issue: <code> block in a <pre> element. Third issue: One of my old browsers uses the standard serif font to format the <code> block, because in a file named hightlight-js.css font-family is reported to be "unset". `‍`` Fourth issue: Please use lokal URL as much as possible: https://forum.dlang.org/font-awesome/4.4.0/css/font-awesome.min.css instead of https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css I strongly dislike those data transmissions to third parties as here: http://www.gravatar.com/avatar/... ```
Apr 01
prev sibling next sibling parent reply =?UTF-8?Q?Ali_=c3=87ehreli?= <acehreli yahoo.com> writes:
On 4/1/21 12:27 AM, Vladimir Panteleev wrote:

 (This post best viewed on [forum.dlang.org](https://forum.dlang.org/)!)

 Greetings esteemed forum users,

 I am delighted to announce that as of today, you can use rich text
 formatting in forum.dlang.org messages.
Thank you! The March part of these features are impressive. ;) However, some parts of posts are unexpectedly rendered in large font: https://forum.dlang.org/post/1909.13835 ddili.org Is that because I used double dashes at footers and the large font is for the signature of the sender? Ali
Apr 01
parent reply Vladimir Panteleev <thecybershadow.lists gmail.com> writes:
On Thursday, 1 April 2021 at 07:49:50 UTC, Ali Çehreli wrote:
 However, some parts of posts are unexpectedly rendered in large 
 font:

   https://forum.dlang.org/post/1909.13835 ddili.org

 Is that because I used double dashes at footers and the large 
 font is for the signature of the sender?
Looks like the double dashes were being interpreted as underlining the previous line. Added a preprocessing rule to fix this, seems to look better now :)
Apr 01
parent =?UTF-8?Q?Ali_=c3=87ehreli?= <acehreli yahoo.com> writes:
On 4/1/21 1:08 AM, Vladimir Panteleev wrote:

 Added a preprocessing rule to fix this, seems to look 
 better now :)
Very much appreciated! Ali P.S. Unfortunately, the disruption caused by the old forum program dying and porting the old messages to D forums was enough to finally kill the Turkish forums. There seems to be only three active users now, who use it only to announce the monthly Turkish #teaconfs. :)
Apr 01
prev sibling next sibling parent Abdulhaq <alynch4047 gmail.com> writes:
Sounds really good. Can it format Parrot code?
Apr 01
prev sibling next sibling parent reply RazvanN <razvan.nitu1305 gmail.com> writes:
On Thursday, 1 April 2021 at 07:27:38 UTC, Vladimir Panteleev 
wrote:
 (This post best viewed on 
 [forum.dlang.org](https://forum.dlang.org/)!)
Is there any way we can put these guidelines somewhere so that we can link to them on the front page of `forum.dlang.org`? Newcomers and even community members will not know or forget this syntax. Cheers, RazvanN
Apr 01
parent reply Vladimir Panteleev <thecybershadow.lists gmail.com> writes:
On Thursday, 1 April 2021 at 08:22:53 UTC, RazvanN wrote:
 Is there any way we can put these guidelines somewhere so that 
 we can link to them on the front page of `forum.dlang.org`? 
 Newcomers and even community members will not know or forget 
 this syntax.
Of course. I'll add a help section and a link from the posting page.
Apr 01
parent reply RazvanN <razvan.nitu1305 gmail.com> writes:
On Thursday, 1 April 2021 at 08:48:10 UTC, Vladimir Panteleev 
wrote:
 On Thursday, 1 April 2021 at 08:22:53 UTC, RazvanN wrote:
 Is there any way we can put these guidelines somewhere so that 
 we can link to them on the front page of `forum.dlang.org`? 
 Newcomers and even community members will not know or forget 
 this syntax.
Of course. I'll add a help section and a link from the posting page.
Awesome! Thank you for all your work! Cheers, RazvanN
Apr 01
parent russhy <russhy gmail.com> writes:
Great improvements!

```
void main()
{
     writeln("thanks!");
}
```
Apr 01
prev sibling next sibling parent Andre Pany <andre s-e-a-p.de> writes:
On Thursday, 1 April 2021 at 07:27:38 UTC, Vladimir Panteleev 
wrote:
 (This post best viewed on 
 [forum.dlang.org](https://forum.dlang.org/)!)

 [...]
This is really great news, thanks for your effort. but now I am little bit confused. Forum reply shows a checkbox "Enable Markdown". Does this mean Markdown is also supported? What features of markdown are supported? Kind regards Andre
Apr 01
prev sibling next sibling parent Mike Parker <aldacron gmail.com> writes:
On Thursday, 1 April 2021 at 07:27:38 UTC, Vladimir Panteleev 
wrote:

 I am delighted to announce that as of today, you can use rich 
 text formatting in forum.dlang.org messages.
Spectacular, Vladimir. You rock! Now gimme a blog post :-)
Apr 01
prev sibling next sibling parent reply WebFreak001 <d.forum webfreak.org> writes:
On Thursday, 1 April 2021 at 07:27:38 UTC, Vladimir Panteleev 
wrote:
 [...]

 And if the above is not sufficient to express your intent, 
 there is the nuclear option: `$(SCRIPT ...)`, which allows 
 embedding arbitrary JavaScript to format your post in however 
 way you desire. jQuery is preloaded, so go nuts!

 [...]
$(SCRIPT function blink_text() { $('.blink').fadeOut(500); $('.blink').fadeIn(500); } setInterval(blink_text, 1000);) <span class="blink">Awesome!</span> :(
Apr 01
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 4/1/21 8:23 AM, WebFreak001 wrote:
 On Thursday, 1 April 2021 at 07:27:38 UTC, Vladimir Panteleev wrote:
 [...]

 And if the above is not sufficient to express your intent, there is 
 the nuclear option: `$(SCRIPT ...)`, which allows embedding arbitrary 
 JavaScript to format your post in however way you desire. jQuery is 
 preloaded, so go nuts!

 [...]
$(SCRIPT function blink_text() {     $('.blink').fadeOut(500);     $('.blink').fadeIn(500); } setInterval(blink_text, 1000);) <span class="blink">Awesome!</span> :(
I'm looking at https://forum.dlang.org/post/zhlzsaocdupxwgvbrauu forum.dlang.org and nothing special. Should run the script, no?
Apr 01
parent reply Steven Schveighoffer <schveiguy gmail.com> writes:
On 4/1/21 10:30 AM, Andrei Alexandrescu wrote:
 On 4/1/21 8:23 AM, WebFreak001 wrote:
 On Thursday, 1 April 2021 at 07:27:38 UTC, Vladimir Panteleev wrote:
 [...]

 And if the above is not sufficient to express your intent, there is 
 the nuclear option: `$(SCRIPT ...)`, which allows embedding arbitrary 
 JavaScript to format your post in however way you desire. jQuery is 
 preloaded, so go nuts!

 [...]
$(SCRIPT function blink_text() {      $('.blink').fadeOut(500);      $('.blink').fadeIn(500); } setInterval(blink_text, 1000);) <span class="blink">Awesome!</span> :(
I'm looking at https://forum.dlang.org/post/zhlzsaocdupxwgvbrauu forum.dlang.org and nothing special. Should run the script, no?
Check your settings to make sure ddoc processing is turned on. -Steve
Apr 01
parent Per =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
On Thursday, 1 April 2021 at 14:50:31 UTC, Steven Schveighoffer 
wrote:
 Check your settings to make sure ddoc processing is turned on.
I see no entry in the settings "ddoc processing". I see the checkbox for Markdown in the editor, though. That's all I need. I'm using Firefox.
Apr 01
prev sibling next sibling parent reply zjh <fqbqrr 163.com> writes:
`goodjob`
Apr 01
parent zjh <fqbqrr 163.com> writes:
**add some color** to the text?
Apr 01
prev sibling next sibling parent Meta <jared771 gmail.com> writes:
On Thursday, 1 April 2021 at 07:27:38 UTC, Vladimir Panteleev 
wrote:
 (This post best viewed on 
 [forum.dlang.org](https://forum.dlang.org/)!)

 Greetings esteemed forum users,

 I am delighted to announce that as of today, you can use rich 
 text formatting in forum.dlang.org messages.
This is awesome! Thanks Vladimir!
Apr 01
prev sibling next sibling parent reply ag0aep6g <anonymous example.com> writes:
On Thursday, 1 April 2021 at 07:27:38 UTC, Vladimir Panteleev 
wrote:
 I am delighted to announce that as of today, you can use rich 
 text formatting in forum.dlang.org messages.
With Markdown enabled, the forum now eats HTML tags. If I enter "<foo>" and hit "save and preview", I see nothing. Worse, this also happens to quoted text. So if someone else wrote "<foo>" with Markdown disabled, and I reply to that message with Markdown enabled, the quote gets garbled. This also affects entities (e.g. "&#x1F608;").
Apr 01
next sibling parent ag0aep6g <anonymous example.com> writes:
On Thursday, 1 April 2021 at 16:21:42 UTC, ag0aep6g wrote:
 Worse, this also happens to quoted text. So if someone else 
 wrote "<foo>" with Markdown disabled, and I reply to that 
 message with Markdown enabled, the quote gets garbled. This 
 also affects entities (e.g. "&#x1F608;").
Replying to myself with Markdown enabled to demonstrate the effect.
Apr 01
prev sibling parent reply Vladimir Panteleev <thecybershadow.lists gmail.com> writes:
On Thursday, 1 April 2021 at 16:21:42 UTC, ag0aep6g wrote:
 On Thursday, 1 April 2021 at 07:27:38 UTC, Vladimir Panteleev 
 wrote:
 I am delighted to announce that as of today, you can use rich 
 text formatting in forum.dlang.org messages.
With Markdown enabled, the forum now eats HTML tags. If I enter "<foo>" and hit "save and preview", I see nothing.
I have added a lint rule which warns on thus omitted HTML code, and offers to fix it (by adding escaping backslashes).
 Worse, this also happens to quoted text. So if someone else 
 wrote "<foo>" with Markdown disabled, and I reply to that 
 message with Markdown enabled, the quote gets garbled. This 
 also affects entities (e.g. "&#x1F608;").
Yes. This applies to all Markdown formatting in general. This is why Markdown formatting is disabled by default when replying to a post which was not in Markdown. If the author of the reply wishes to enable it, it is on them to ensure that the quoted parts of parent posts still make sense when rendered as Markdown. It's not a problem that's unsolvable mechanically, but it would require that the "Enable Markdown" checkbox, in this circumstance, instead be presented as a button, which wraps quoted parts from the parent into code blocks, or other constructs which disable interpreting Markdown.
Apr 02
parent reply ag0aep6g <anonymous example.com> writes:
On 02.04.21 09:56, Vladimir Panteleev wrote:
 On Thursday, 1 April 2021 at 16:21:42 UTC, ag0aep6g wrote[...]
 I have added a lint rule which warns on thus omitted HTML code, and 
 offers to fix it (by adding escaping backslashes).
Nice, but the warning doesn't show up for me. Probably not deployed yet? Does the forum even support any HTML tags? If not, there's no point in stripping them. But maybe that's a limitation of the Markdown library you're using. [...]
 Yes. This applies to all Markdown formatting in general. This is why 
 Markdown formatting is disabled by default when replying to a post which 
 was not in Markdown. If the author of the reply wishes to enable it, it 
 is on them to ensure that the quoted parts of parent posts still make 
 sense when rendered as Markdown.
As far as I'm aware, the newsgroup and mailing list interfaces are popular among forum regulars. If replying to them with Markdown is difficult, that's going to be annoying for the web users. Luckily, the difference Markdown makes will be benign most of the time. It's not a big deal when "**emphasis**" or "`some code`" get interpreted as Markdown.
Apr 02
parent reply Vladimir Panteleev <thecybershadow.lists gmail.com> writes:
On Friday, 2 April 2021 at 10:12:25 UTC, ag0aep6g wrote:
 On 02.04.21 09:56, Vladimir Panteleev wrote:
 On Thursday, 1 April 2021 at 16:21:42 UTC, ag0aep6g wrote[...]
 I have added a lint rule which warns on thus omitted HTML 
 code, and offers to fix it (by adding escaping backslashes).
Nice, but the warning doesn't show up for me. Probably not deployed yet?
No, it's deployed. Note, though, that the check runs when you click "Send". You can use the hidden old D group for testing: https://forum.dlang.org/group/D
 Does the forum even support any HTML tags? If not, there's no 
 point in stripping them. But maybe that's a limitation of the 
 Markdown library you're using.
The implementation does provide a knob with two settings (strip all HTML or allow all HTML). I don't know if it's due to a technical limitation of that particular implementation. I suspect that the reason may be something along the lines of that for the purposes of the formal specification, there should be a simple and clear rule for when sequences of characters are interpreted as HTML vs. when they are not, or something like that.
 As far as I'm aware, the newsgroup and mailing list interfaces 
 are popular among forum regulars. If replying to them with 
 Markdown is difficult, that's going to be annoying for the web 
 users.

 Luckily, the difference Markdown makes will be benign most of 
 the time. It's not a big deal when "**emphasis**" or "`some 
 code`" get interpreted as Markdown.
Yes. But also, though formatting is indeed very useful for *some* posts, it will not significantly improve the majority of posts.
Apr 02
next sibling parent ag0aep6g <anonymous example.com> writes:
On 02.04.21 12:23, Vladimir Panteleev wrote:
 On Friday, 2 April 2021 at 10:12:25 UTC, ag0aep6g wrote:
 On 02.04.21 09:56, Vladimir Panteleev wrote:
 On Thursday, 1 April 2021 at 16:21:42 UTC, ag0aep6g wrote[...]
 I have added a lint rule which warns on thus omitted HTML code, and 
 offers to fix it (by adding escaping backslashes).
Nice, but the warning doesn't show up for me. Probably not deployed yet?
No, it's deployed. Note, though, that the check runs when you click "Send".
I see. I think it should trigger on "save and preview", though. That's when the author is ready to make corrections. The replacement is overzealous. It also affects tags in backticks where the Markdown processor already handles them. For example, this: `<foo>` <foo> becomes this: `\<foo>` \<foo> but it should become this: `<foo>` \<foo> [...]
 The implementation does provide a knob with two settings (strip all HTML 
 or allow all HTML). I don't know if it's due to a technical limitation 
 of that particular implementation. I suspect that the reason may be 
 something along the lines of that for the purposes of the formal 
 specification, there should be a simple and clear rule for when 
 sequences of characters are interpreted as HTML vs. when they are not, 
 or something like that.
Weird that there's no setting "escape all HTML" or at least "error on all HTML".
Apr 02
prev sibling parent reply ag0aep6g <anonymous example.com> writes:
On Friday, 2 April 2021 at 10:23:29 UTC, Vladimir Panteleev wrote:
 On Friday, 2 April 2021 at 10:12:25 UTC, ag0aep6g wrote:
[...]
 Does the forum even support any HTML tags? If not, there's no 
 point in stripping them. But maybe that's a limitation of the 
 Markdown library you're using.
The implementation does provide a knob with two settings (strip all HTML or allow all HTML). I don't know if it's due to a technical limitation of that particular implementation. I suspect that the reason may be something along the lines of that for the purposes of the formal specification, there should be a simple and clear rule for when sequences of characters are interpreted as HTML vs. when they are not, or something like that.
In my opinion, the proper solution would be to escape HTML before passing the string to the Markdown processor. So when I enter this: <b>bold?</b> **bold!** First turn it into this: &lt;b&gt;bold?&lt;/b&gt; **bold!** Then pass that to the Markdown processor which turns it into this for the browser: &lt;b&gt;bold?&lt;/b&gt; <b>bold!</b> And newsgroup users get the original input, no "\<" or "&lt;". The Markdown processor won't strip any tags, because it won't see any to begin with.
Apr 06
parent reply Vladimir Panteleev <thecybershadow.lists gmail.com> writes:
On Tuesday, 6 April 2021 at 22:01:42 UTC, ag0aep6g wrote:
 In my opinion, the proper solution would be to escape HTML 
 before passing the string to the Markdown processor.
Escaping all HTML special characters, regardless of context, would break: - using said characters within code blocks (inline and otherwise), where the Markdown processor treats them verbatim; - using them in Markdown syntax constructs, such as block quotes (though arguably we only need to escape `<`) and <URL>s (which arguably isn't very useful as we have GitHub auto-links turned on). So, this transformation would need to be as part of the Markdown parsing process (or otherwise replicate a subset of it, to know when to escape and when not to, which is bound to be fragile). GitHub's implementation does add a few settings regarding HTML, but they seem to be mainly about allowing certain HTML tags (which we don't want to do, as HTML makes messages less readable in plain text). FWIW, github.com also strips HTML tags that it does not recognize, and doesn't even warn you.
Apr 06
parent ag0aep6g <anonymous example.com> writes:
On 07.04.21 08:16, Vladimir Panteleev wrote:
 Escaping all HTML special characters, regardless of context, would break:
 
 - using said characters within code blocks (inline and otherwise), where 
 the Markdown processor treats them verbatim;
 
 - using them in Markdown syntax constructs, such as block quotes (though 
 arguably we only need to escape `<`) and <URL>s (which arguably isn't 
 very useful as we have GitHub auto-links turned on).
 
 So, this transformation would need to be as part of the Markdown parsing 
 process (or otherwise replicate a subset of it, to know when to escape 
 and when not to, which is bound to be fragile).
Ah, dang it. Never mind then. Thanks for indulging me.
Apr 07
prev sibling next sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 4/1/2021 12:27 AM, Vladimir Panteleev wrote:
 I am delighted to announce that as of today, you can use rich text formatting
in 
 forum.dlang.org messages.
I am delighted that you've added this! Sweet! Inevitably, I have a suggestion. I've been opposed to adding Markdown support to Ddoc. But some has been added, and I was wrong. Ddoc needs to support Markdown. I recommend adding some Markdown to Dfeed. As to which flavor of Markdown, use the one we're familiar with - the Github flavor.
Apr 01
parent reply Arun <aruncxy gmail.com> writes:
On Thursday, 1 April 2021 at 17:52:38 UTC, Walter Bright wrote:
 On 4/1/2021 12:27 AM, Vladimir Panteleev wrote:
 I am delighted to announce that as of today, you can use rich 
 text formatting in forum.dlang.org messages.
I am delighted that you've added this! Sweet! Inevitably, I have a suggestion. I've been opposed to adding Markdown support to Ddoc. But some has been added, and I was wrong. Ddoc needs to support Markdown. I recommend adding some Markdown to Dfeed. As to which flavor of Markdown, use the one we're familiar with - the Github flavor.
DFeed supports GH markdown - https://forum.dlang.org/help#markdown
Apr 01
parent Walter Bright <newshound2 digitalmars.com> writes:
On 4/1/2021 12:59 PM, Arun wrote:
 DFeed supports GH markdown - https://forum.dlang.org/help#markdown
I didn't know that. Good!
Apr 01
prev sibling next sibling parent reply =?UTF-8?Q?Ali_=c3=87ehreli?= <acehreli yahoo.com> writes:
After a failed test, Vladimir wrote the following in private email:

<quote>
That post has the header:

Content-Type: text/plain; charset=utf-8; format=flowed

So, it's not rendered as Markdown because there is no
"markup=markdown" announced there.
</quote>

My problem is, I cannot find a way to add that in Thunderbird. Doing 
what the following page suggests about .headers and .header for 
"Content-Type" seemingly quietly fails and as a result, although the 
message is sent, e.g. the Subject line disappears. Information here:

   http://kb.mozillazine.org/Custom_headers

Ali's warning: Do not do the following; it does not work and at least 
the Subject header disappears.

     user_pref("mail.identity.id4.headers", "markdown");
     user_pref("mail.identity.id4.header.markdown", "Content-Type: 
markup=markdown");

On the other hand, I am able to add headers other than Content-Type. So, 
perhaps Vladimir can support something like the following?

   X-Markup: markdown

Ali
Apr 01
parent reply Vladimir Panteleev <thecybershadow.lists gmail.com> writes:
On Thursday, 1 April 2021 at 18:22:47 UTC, Ali Çehreli wrote:
 On the other hand, I am able to add headers other than 
 Content-Type. So, perhaps Vladimir can support something like 
 the following?

   X-Markup: markdown
This method of advertising Markdown content was chosen because there is precedent for it: https://www.google.com/search?q=%22Content-Type%22+%22markup%3Dmarkdown%22 As such, I think deviating from this convention would not be in line with maximizing interoperability. I think the best way to add this to Thunderbird would be to write a small extension. Perhaps the extension could even provide a preview of the Markdown render, which would be useful to avoid accidentally mis-formatting the text, or even allow authoring messages in a WYSIWYG style (using one of the many available JavaScript/HTML Markdown WYSIWYG editors).
Apr 01
parent Steven Schveighoffer <schveiguy gmail.com> writes:
On 4/1/21 8:57 PM, Vladimir Panteleev wrote:
 On Thursday, 1 April 2021 at 18:22:47 UTC, Ali Çehreli wrote:
 On the other hand, I am able to add headers other than Content-Type. 
 So, perhaps Vladimir can support something like the following?

   X-Markup: markdown
This method of advertising Markdown content was chosen because there is precedent for it: https://www.google.com/search?q=%22Content-Type%22+%22markup%3Dmarkdown%22 As such, I think deviating from this convention would not be in line with maximizing interoperability. I think the best way to add this to Thunderbird would be to write a small extension. Perhaps the extension could even provide a preview of the Markdown render, which would be useful to avoid accidentally mis-formatting the text, or even allow authoring messages in a WYSIWYG style (using one of the many available JavaScript/HTML Markdown WYSIWYG editors).
You can support both Content-Type and X-Markup (or whatever), no? I mean, we are talking the difference between writing a custom plugin for a desktop application and changing a couple lines in the server to look at a possible other header. -Steve
Apr 02
prev sibling next sibling parent Geert <gerndz gmail.com> writes:
```d
writeln("This is great, thanks!");
```
Apr 01
prev sibling next sibling parent Martin <martin.brzenska googlemail.com> writes:
On Thursday, 1 April 2021 at 07:27:38 UTC, Vladimir Panteleev 
wrote:

 `$(SCRIPT ...)`, which allows embedding arbitrary JavaScript
lol, good one!
Apr 01
prev sibling next sibling parent Imperatorn <johan_forsberg_86 hotmail.com> writes:
On Thursday, 1 April 2021 at 07:27:38 UTC, Vladimir Panteleev 
wrote:
 (This post best viewed on 
 [forum.dlang.org](https://forum.dlang.org/)!)

 [...]
This is the best day of my life. Thank you!
Apr 01
prev sibling next sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 4/1/2021 12:27 AM, Vladimir Panteleev wrote:
 And if the above is not sufficient to express your intent, there is the
nuclear 
 option: `$(SCRIPT ...)`, which allows embedding arbitrary JavaScript to format 
 your post in however way you desire. jQuery is preloaded, so go nuts!
I'm concerned about running arbitrary scripts - what if bad people post malicious scripts that unsuspecting forum readers may run by reading the message? Could the Dfeed server be compromised by them?
Apr 01
next sibling parent reply =?UTF-8?Q?Ali_=c3=87ehreli?= <acehreli yahoo.com> writes:
On 4/1/21 12:42 PM, Walter Bright wrote:

 I'm concerned about running arbitrary scripts - what if bad people post
 malicious scripts that unsuspecting forum readers may run by reading the
 message? Could the Dfeed server be compromised by them?
Vladimir is implementing better checks against bad people. Malicious code will automatically be bounced back to the attacker. Stay tuned... Ali
Apr 01
parent reply =?UTF-8?Q?Ali_=c3=87ehreli?= <acehreli yahoo.com> writes:
On 4/1/21 1:24 PM, Ali =C3=87ehreli wrote:
 On 4/1/21 12:42 PM, Walter Bright wrote:
=20
  > I'm concerned about running arbitrary scripts - what if bad people p=
ost
  > malicious scripts that unsuspecting forum readers may run by reading=
the
  > message? Could the Dfeed server be compromised by them?
=20
 Vladimir is implementing better checks against bad people. Malicious=20
 code will automatically be bounced back to the attacker. Stay tuned...
It case it wasn't clear, it's finally April 2. ;) Maybe the joke is on=20 me but I took neither Ddoc nor SCRIPT support seriously. Ali
Apr 02
parent surlymoor <surlymoor cock.li> writes:
On Friday, 2 April 2021 at 12:29:22 UTC, Ali Çehreli wrote:
 It case it wasn't clear, it's finally April 2. ;) Maybe the 
 joke is on me but I took neither Ddoc nor SCRIPT support 
 seriously.
I have to admit: I initially believed the DDOC statement--the more subtle, the better!
Apr 02
prev sibling next sibling parent Patrick Schluter <Patrick.Schluter bbox.fr> writes:
On Thursday, 1 April 2021 at 19:42:24 UTC, Walter Bright wrote:
 On 4/1/2021 12:27 AM, Vladimir Panteleev wrote:
 And if the above is not sufficient to express your intent, 
 there is the nuclear option: `$(SCRIPT ...)`, which allows 
 embedding arbitrary JavaScript to format your post in however 
 way you desire. jQuery is preloaded, so go nuts!
I'm concerned about running arbitrary scripts - what if bad people post malicious scripts that unsuspecting forum readers may run by reading the message? Could the Dfeed server be compromised by them?
Apr 02
prev sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 4/1/2021 12:42 PM, Walter Bright wrote:
 I'm concerned about running arbitrary scripts - what if bad people post 
 malicious scripts that unsuspecting forum readers may run by reading the 
 message? Could the Dfeed server be compromised by them?
This just showed up on HackerNews: https://www.paulosyibelo.com/2021/04/this-man-thought-opening-txt-file-is.html
Apr 02
parent reply Steven Schveighoffer <schveiguy gmail.com> writes:
On 4/2/21 10:59 PM, Walter Bright wrote:
 On 4/1/2021 12:42 PM, Walter Bright wrote:
 I'm concerned about running arbitrary scripts - what if bad people 
 post malicious scripts that unsuspecting forum readers may run by 
 reading the message? Could the Dfeed server be compromised by them?
This just showed up on HackerNews: https://www.paulosyibelo.com/2021/04/this-man-thought-opening-txt-file-is.html
Walter, the DDOC stuff, and especially the $(SCRIPT) part was a well done April fools joke ;) To recap: 1. Markdown is implemented, not DDOC 2. There is no arbitrary scripting available. -Steve
Apr 03
next sibling parent Dennis <dkorpel gmail.com> writes:
On Saturday, 3 April 2021 at 12:18:56 UTC, Steven Schveighoffer 
wrote:
 Walter, the DDOC stuff, and especially the $(SCRIPT) part was a 
 well done April fools joke ;)
It's such a good one, best one this year for me. It works so well because it starts and ends truthfully: he actually implemented a long requested feature, and then only joked about the syntax. So you're kind of like "the implementation is a bit iffy, but it can be improved later". Then when you go back to the post with hindsight, you wonder how you possibly fell for it.
 There already exists an elegant and well-established markup 
 language that members of our community are well familiar with, 
 which is what has been implemented today. I am, of course, 
 talking about DDoc!
 Tables are even easier:
 *example with 4 different macros*
Apr 03
prev sibling parent Johannes Loher <johannes.loher fg4f.de> writes:
On Saturday, 3 April 2021 at 12:18:56 UTC, Steven Schveighoffer 
wrote:
 Walter, the DDOC stuff, and especially the $(SCRIPT) part was a 
 well done April fools joke ;)

 To recap:

 1. Markdown is implemented, not DDOC
 2. There is no arbitrary scripting available.

 -Steve
To be honest, I thought the _whole_ thing was a joke. Didn’t think this would be something people would like due to them using the newsgroup thing... 😅
Apr 04
prev sibling next sibling parent Per =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
On Thursday, 1 April 2021 at 07:27:38 UTC, Vladimir Panteleev 
wrote:
 Happy DDoc-ing!
Awesome!
Apr 01
prev sibling next sibling parent reply surlymoor <surlymoor cock.li> writes:
On Thursday, 1 April 2021 at 07:27:38 UTC, Vladimir Panteleev 
wrote:
 And if the above is not sufficient to express your intent, 
 there is the nuclear option: `$(SCRIPT ...)`, which allows 
 embedding arbitrary JavaScript to format your post in however 
 way you desire. jQuery is preloaded, so go nuts!
Easily the best one I've seen today! Well done.
Apr 01
parent Aliak <something something.com> writes:
On Thursday, 1 April 2021 at 20:22:04 UTC, surlymoor wrote:
 On Thursday, 1 April 2021 at 07:27:38 UTC, Vladimir Panteleev 
 wrote:
 And if the above is not sufficient to express your intent, 
 there is the nuclear option: `$(SCRIPT ...)`, which allows 
 embedding arbitrary JavaScript to format your post in however 
 way you desire. jQuery is preloaded, so go nuts!
Easily the best one I've seen today! Well done.
Agreed!! 😆 👏👏👏
Apr 01
prev sibling next sibling parent reply superbomba <superbomba gmail.com> writes:
On Thursday, 1 April 2021 at 07:27:38 UTC, Vladimir Panteleev 
wrote:
 ...
I think there's something wrong, please see this topic: https://forum.dlang.org/post/wutkgkavtvggfvrqjtpv forum.dlang.org I am getting this: https://i.imgur.com/Iu4enN8.png Is this right?
Apr 02
parent reply superbomba <super gmail.com> writes:
On Friday, 2 April 2021 at 19:01:09 UTC, superbomba wrote:
 On Thursday, 1 April 2021 at 07:27:38 UTC, Vladimir Panteleev 
 wrote:
 ...
I think there's something wrong, please see this topic: https://forum.dlang.org/post/wutkgkavtvggfvrqjtpv forum.dlang.org I am getting this: https://i.imgur.com/Iu4enN8.png Is this right?
So for what It seems the Markdown formatting is wrong in this case. But looking forward there is this another thread: https://forum.dlang.org/thread/s453vl$2pl3$1 digitalmars.com Which seems to have the right Markdown but doesn't no shows any formatting, and then I was told that is because it was from the e-mail client. Shouldn't the front-end take care of this?
Apr 02
parent ryuukk_ <ryuukk_ gmail.com> writes:
Some messages have different fonts, this is very distracting when 
reading messages

Is it possible to have posts use the same font no matter if it is 
rendered using markdown or no? that'll help with consistency

Other than that, i like this addition, it makes pasting code 
looks much cleaner etc, good job!
Apr 02
prev sibling next sibling parent Per =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
On Thursday, 1 April 2021 at 07:27:38 UTC, Vladimir Panteleev 
wrote:
 (This post best viewed on 
 [forum.dlang.org](https://forum.dlang.org/)!)

 [...]
Why not make the Markdown checkbox active by default? Easier to read variable width font.
Apr 03
prev sibling next sibling parent reply aberba <karabutaworld gmail.com> writes:
On Thursday, 1 April 2021 at 07:27:38 UTC, Vladimir Panteleev 
wrote:
 (This post best viewed on
```d import std.stdio: writeln; void nice() { writeln("It works!"); } ``` Cool!
Apr 04
parent reply Imperatorn <johan_forsberg_86 hotmail.com> writes:
On Sunday, 4 April 2021 at 10:57:38 UTC, aberba wrote:
 On Thursday, 1 April 2021 at 07:27:38 UTC, Vladimir Panteleev 
 wrote:
 (This post best viewed on
```d import std.stdio: writeln; void nice() { writeln("It works!"); } ``` Cool!
Coming up: Integrated "Run this" button for each block 😍
Apr 04
parent Per =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
On Sunday, 4 April 2021 at 11:08:44 UTC, Imperatorn wrote:
 Integrated "Run this" button for each block 😍
Yes, please!
Apr 04
prev sibling next sibling parent reply Kagamin <spam here.lot> writes:
Looks like feature falls for the reddit failure, when people post 
text intending for it to be wysiwyg only to be mutilated by 
markdown.
Apr 07
parent Paul Backus <snarwin gmail.com> writes:
On Wednesday, 7 April 2021 at 12:57:50 UTC, Kagamin wrote:
 Looks like feature falls for the reddit failure, when people 
 post text intending for it to be wysiwyg only to be mutilated 
 by markdown.
Indeed. Probably better UX to make Markdown opt-in instead of opt-out.
Apr 07
prev sibling parent reply IGotD- <nise nise.com> writes:
On Thursday, 1 April 2021 at 07:27:38 UTC, Vladimir Panteleev 
wrote:
 (This post best viewed on 
 [forum.dlang.org](https://forum.dlang.org/)!)

 Greetings esteemed forum users,

 I am delighted to announce that as of today, you can use rich 
 text formatting in forum.dlang.org messages.

 [...]

 Happy DDoc-ing!

 — Vladimir
Thank you. Is there a way we can make this information easily accessible in the forum index? This thread will be buried in time and I will certainly forget the formatting rules. A nice quick guide easily accessible at the menu on the left would be nice.
Apr 11
parent reply Paul Backus <snarwin gmail.com> writes:
On Sunday, 11 April 2021 at 21:41:16 UTC, IGotD- wrote:
 Thank you. Is there a way we can make this information easily 
 accessible in the forum index? This thread will be buried in 
 time and I will certainly forget the formatting rules. A nice 
 quick guide easily accessible at the menu on the left would be 
 nice.
Click on the "Help" link at the upper-right of any forum page.
Apr 11
parent reply IGotD- <nise nise.com> writes:
On Sunday, 11 April 2021 at 22:30:00 UTC, Paul Backus wrote:
 On Sunday, 11 April 2021 at 21:41:16 UTC, IGotD- wrote:
 Thank you. Is there a way we can make this information easily 
 accessible in the forum index? This thread will be buried in 
 time and I will certainly forget the formatting rules. A nice 
 quick guide easily accessible at the menu on the left would be 
 nice.
Click on the "Help" link at the upper-right of any forum page.
Nice to see that you beat me to it.
Apr 11
parent Steven Schveighoffer <schveiguy gmail.com> writes:
On 4/11/21 6:42 PM, IGotD- wrote:
 On Sunday, 11 April 2021 at 22:30:00 UTC, Paul Backus wrote:
 Click on the "Help" link at the upper-right of any forum page.
Nice to see that you beat me to it.
Also, the "Markdown" part of the "Enable Markdown" label for the checkbox is clickable and brings you directly to the help for it. To remind everyone, all the information in the OP of this thread was an April fools joke, and not correct. -Steve
Apr 11