*

Offline xasop

  • Administrator
  • *****
  • Posts: 9776
  • Professional computer somebody
    • View Profile
Allow markdown for post formatting
« on: June 30, 2020, 01:47:29 AM »
Markdown is much easier to write than BBcode, being little more than structured plain text. It would be nice if we could use it to format posts.

For example, here's some BBcode:

Code: [Select]
[size=1.4em][b]Heading[/b][/size]

I like [b]bold[/b] and [i]italic[/i] and also [url=https://www.youtube.com/watch?v=g1p5eNOsl7I]links[/url].

[size=1.2em][b]Subheading[/b][/size]

[list]
[li]Do you like green eggs and ham?[/li]
[li]I do not like them, Sam I Am.[/li]
[/list]

[code]
#include <stdio.h>
int main(int argc, char **argv) {
    printf("Write in C\n");
}
[­/code]

[tex]\mathrm{e}^{\mathrm{i\pi}} + 1 = 0[/tex]

Now here's the same thing, written in markdown using pandoc's inline LaTeX extension:

Code: [Select]
# Heading

I like **bold** and *italic* and also [links](https://www.youtube.com/watch?v=g1p5eNOsl7I).

## Subheading

* Do you like green eggs and ham?
* I do not like them, Sam I Am.

```
#include <stdio.h>
int main(int argc, char **argv) {
    printf("Write in C\n");
}
```

$\mathrm{e}^{\mathrm{i\pi}} + 1 = 0$

As you can see, the markdown version is much easier to read and edit in its raw form.

However, I don't want to switch between markdown and BBcode. BBcode can do some more complex things that don't suit the simplicity of markdown, and so they should both be available, and it should be possible to combine them. This will be tricky with SMF's awful BBcode parser, but I believe the benefits should be worthwhile.
« Last Edit: June 30, 2020, 01:52:56 AM by Пардисфла »
when you try to mock anyone while also running the flat earth society. Lol

*

Offline Dr David Thork

  • *
  • Posts: 5188
  • https://onlyfans.com/thork
    • View Profile
Re: Allow markdown for post formatting
« Reply #1 on: June 30, 2020, 06:26:10 AM »
As you can see, the markdown version is much easier to read and edit in its raw form.
No its not.

it should be possible to combine them.
What a horrible idea. You are the only person who will use markdown and the rest of us will have our posts inadvertently mutilated as the markdown overrides our intentions like the much maligned

1)
2)
3)
4)
5)
6)
7)
8)  <-- when of course the person making the list wants 8)
9)
10)

Make it either or ... not both.
Rate this post.      👍 6     👎 1

*

Offline Pete Svarrior

  • e
  • Planar Moderator
  • *****
  • Posts: 16073
  • (◕˽ ◕ ✿)
    • View Profile
Re: Allow markdown for post formatting
« Reply #2 on: June 30, 2020, 11:17:17 AM »
I'm unconvinced that there would be much of an uptake of for this, but in principle it can't hurt if implemented correctly. If implemented incorrectly, it'd just make life harder while providing very little benefit.

The only way I can see this being feasible without an extreme overhaul is to introduce a [markdown] block BBCode. Maybe something like [md] if you'd like it shorter. You can then thwack anything within the block through a markdown parser. This also has the added benefit of not mangling previous posts, and of not impacting those who'd like to use an asterisk as a simple symbol instead of a Turing machine.
Read the FAQ before asking your question - chances are we already addressed it.
Follow the Flat Earth Society on Twitter and Facebook!

If we are not speculating then we must assume

*

Offline xasop

  • Administrator
  • *****
  • Posts: 9776
  • Professional computer somebody
    • View Profile
Re: Allow markdown for post formatting
« Reply #3 on: June 30, 2020, 01:43:23 PM »
The only way I can see this being feasible without an extreme overhaul is to introduce a [markdown] block BBCode. Maybe something like [md] if you'd like it shorter. You can then thwack anything within the block through a markdown parser. This also has the added benefit of not mangling previous posts, and of not impacting those who'd like to use an asterisk as a simple symbol instead of a Turing machine.

My thought was to add a per-post "Use markdown" setting, with a per-user "Use markdown" setting that defines the default per-post setting. That way, all existing posts are flagged as not using markdown, while new posts follow the user's preference.

The benefit over a BBcode tag is just that I wouldn't need to wrap every single post in [markdown].
when you try to mock anyone while also running the flat earth society. Lol

*

Offline Pete Svarrior

  • e
  • Planar Moderator
  • *****
  • Posts: 16073
  • (◕˽ ◕ ✿)
    • View Profile
Re: Allow markdown for post formatting
« Reply #4 on: June 30, 2020, 02:25:30 PM »
To me, this sounds like an attempt to add complexity to an already overly complex system. I can't envision it going well. My vote would be firmly against.

If the concern is that you might have to wrap your posts in a tag, you could give youself an option to perform this wrapping automatically.
Read the FAQ before asking your question - chances are we already addressed it.
Follow the Flat Earth Society on Twitter and Facebook!

If we are not speculating then we must assume