Sublime Forum

Formatting in this forum

#1

Just a note

as you can see, the formatting on the left doesn’t match on the right, and often the final result doesn’t match either.

I’m guessing nested formatting isn’t available, ie have bold in quotes in itallics ?

0 Likes

#2

That’s because like most forums, Discourse uses Markdown for it’s forum language. Markdown is converted into HTML for display, and HTML notoriously takes liberties with what you typed unless you specifically tell it otherwise.

In particular, whitespace is of no consequence to HTML; multiple spaces in a row get compressed away:


// Invoke the pipe text wrapper; this may end up being in the command
// palette with input handlers.
{
“keys”: [“super+x”],
“command”: “show_overlay”,
“args”: {
“overlay”: “command_palette”,
“command”: “pipe_text_wrapper”
}
},

Trying to include HTML tags ends up not doing what you want, like if you were to ask for help as to why this div doesn’t display properly:

my div content

If you know markdown, you can use that to mark up your post so that it converts properly:

// Invoke the pipe text wrapper; this may end up being in the command
// palette with input handlers.
{
    "keys": ["super+x"],
    "command": "show_overlay",
    "args": {
        "overlay": "command_palette",   
        "command": "pipe_text_wrapper"
    }
},
<div>my div content</div>

If you’re unfamiliar with markdown, then you can avail yourself of the options provided in the toolbar above the edit area; hovering your mouse over the buttons there will tell you what they do:

Thus you can also use those to make your posts appear more like you want them to:

// Invoke the pipe text wrapper; this may end up being in the command
// palette with input handlers.
{
    "keys": ["super+x"],
    "command": "show_overlay",
    "args": {
        "overlay": "command_palette",   
        "command": "pipe_text_wrapper"
    }
},

<div>my div content</div>

Using them adjusts the text as appropriate, which also serves to show you how you could enter the text manually without having to resort to the buttons.

For example, you use *asterisks* in single to get italic text, or **doubled asterisks** to get bold text or ***tripled asterisks*** to get bold and italic text. All markup appears where you want, so you can indeed get “nested bold and italic in quotes” if you want it.

One of the conversions that happens to text is that ‘single’ and “double quotes” get converted into “fancy” curved quotes (i.e. typographical quotes). If what you’re doing is quoting someone, that’s fine. If you’re trying to share a key binding or code, the translation makes it “broken” for other uses:

// Does this compile? No, because those double quotes are invalid; compilers want " quotes.
const char *var = “a broken string constant”;

It also pays to pay careful attention to the preview pane on the right, which will show you on the fly what your post appears like (as you noted in your image above).

Anyone that comes along to help you has to interpret what you asked (and how you asked it) to be able to provide help. If your question isn’t properly formatted, it makes it that much harder for someone to help or even understand your problem, which can lead to people “ignoring” your question as being to difficult or time consuming to want to answer.

2 Likes

#3

A quick google pointed out this unofficial discourse user reference guide that may be of some assistance in some of the other things that are available to you formatting-wise.

0 Likes

#4

Below is an example of a reply is was going to make, but realised I’d misunderstood something. I was going to then reference that post in this post as it contains many examples of the formatting issues I keep encountering. However I realised I was talking nonsense in my original post. However it does demonstrate the issues I still continue to have…

I do have to digest your excellent post more thoroughly, but (an this is kinda one of the issues with ST3 too) I just want to be able to post something, not have to learn a basic knowledge of html (or python in ST3’s case) just to do something that should be very easy. I’m on one other forum (Nabble for N2T) it has a very similar set up (though actually it’s a bit simpler and therefore easier to use). It has the buttons/bar above the text box, but it uses <\i> <\i> and <\b> <\b> (I can’t use the real symbols obvs), which I see this uses as well as the double and single stars. Why make stuff more complicated than it needs to be ? The Nabble forum is much easier to post on, seems to be less glitchy etc etc… (BTW it’s just my experience)

In terms of learning stuff, am happy to do it, the problem is I don’t have infinite time and I’d like to get on with the stuff I need/want to get on with, and not learning other stuff that should be completely ancillary.

Firstly I’ve been using the bar above, as you suggest (I’ll use bold to distinguish my current speech from the examples below). The below paragraph, I hit the quote icon (the little speach bubble) and copied and pasted the following paragraph in, then put it in italics, it looks like I just got italics. I wanted both, to show that it was a quote, and to differentiate between you and me:

If you turn on Save all on build in the Tools menu, any time you trigger a build every file that already has a name on disk will be saved before the build happens. So if it’s alright with you that all of your unsaved files be persisted, you can do that without requiring any sort of key binding at all other than the default.

The following was meant to be in bold and italics, again just using the bar above

** every file that already has a name on disk will be saved before the build happens.**

And the final paragraph worked

any time you trigger a build every file that already has a name on disk will be saved before the build happens

I’ll brush up on my html (at some point I’m sure I’ll have to learn it anyway).

Again thanks for your detailed reply, I’ll digest further when I’ve got a bit more time (or have some further procrastination to do !)

:unicorn: :+1:

Ps The formatting might be a bit dodgey, but the emoji’s are great !!

Pps https://forum.digikey.com/t/an-unofficial-discourse-user-reference-guide/1125

In that post I’d done what I thought was the same thing for each bit of quoted code, but in fact I had two completely different results…

0 Likes

#5

I relation to your last two paragraphs, yes the preveiw pane on the right often doesn’t agree with what’s on the left (as per OP)

Yes I agree completely, I’ve been struggling with this formatting issue on this forum for nearly a year, “trying to make myself understood” :wink:

Thanks, I’ll check out the guide…

1 Like

#6


is a great link, easily digestable, I was expecting something monstrous, but not at all. Great link thanks.
If I had the opportunity to make a suggestion, that link posted significantly (this is the wrong word but i can’t think of the right one) on the header page of this forum so that folks know would’ve really helped me in the beginning.
That’s something that seems to get lost occasionally is the idea that we were all beginners once. However not in terms of this forum’s replies (except for the odd troll) everyone’s really helpful. Thanks @OdatNurd !

:unicorn:

0 Likes