Can you please replace the “Preformatted text” Symbol in the Forum Editor with a Symbol that represents Code or Xojo Code, or can you try to detect if the Person is posting Code and advice him/her to please enclose it within <code></code> Tags?
Because many users don’t seem to know that this option exists and therefore code is often posted as plain text.
But that’s exactly my point. Many users don’t see that this option exists.
That’s why I would be in favor of a button that is more clearly recognizable as a code-formatting-button and, if possible, a method that recognizes when entering that it could be code and recommends marking it as such.
I tend to agree. While I do know about this button, I always have to take time to differentiate the </> and ” buttons. Would be great if the </> could be changed.
(I don’t even know what the other one does )
I doubt this will be changed, even if it can be easily changed. And I would, personally, recommend against it…vehemently.
The </> symbol is pretty standard for “code” in editors and has been for many years. Additionally, it wouldn’t make sense to change it to something like the Xojo icon because it supports – and is used for, even here – so many more languages.
See this link for more information about how to format different languages.
See this link for a look at the source code to see which languages are supported by the forums Markdown renderer.
The possible answer is, as in most cases, user education. Some kind of new user guide (Discourse has tons of them, such as the one I posted earlier and this one). Although if they’ve read the Forum Guidelines, it’s also listed there.
That’s subjective. Anyone who’s done work in HTML, even minimally, probably understands that quite well thanks to the existence of the <pre> tag since the early 90s.
OK. Not a problem. We can disagree. All I’m saying is that the current icon and verbiage is fairly standard in tech and changes probably wouldn’t help with the issue despite the time spent on it and, at worst, could further confuse another subset of users. Most of those not formatting their code properly probably didn’t bother to see if there was a way to format their code properly. User education is the best path forward, and a lot of us do that (I see you do it quite frequently) when they don’t bother to look around on their own.
Maybe I’m dense but for the longest time I hadn’t realized myself that the preformatted option isn’t just for preformatted text but can apply it’s own formatting to code snippets. I mean that’s pretty much the opposite of what ‘preformatted’ normally means, no? In HTML one uses ‘PRE’ for text that should be rendered exactly as it is, rather than applying some formatting rules.
In other words I’m all for Sascha’s suggestion (and changing the icon and wording – ‘Code’ instead of ‘Preformatted text’ – shouldn’t be too difficult).
Preformatted text merely ensures that formatting (fixed character width, spacing, characters displayed, and line breaks) are preserved. It is common, and has been for some years now, for <pre> to also be the basis for syntax highlighting as those criteria are necessary for displaying source code. The <code> tag came sometime later, but it makes little difference in this context. The same button results in the same markdown to display text or code, with optional code highlighting. The </> is for preformatted text with optional syntax highlighting.
At this point, it’s all academic and a question of preference rather than usefulness, so I’m turning off thread notifications.