Can the Unformatted Code Detector be disabled per user?

Users posting unformatted code will see a warning message instructing them how to format it correctly.

:triangular_flag_on_post: Not a fan of content detection… Will users be able to disable this or is it going to be enforced? :confused:

The link to this topic should probably open in a new window by default so people can post to this thread after they get this warning whilst posting on another.

They will, but only per-device as per:

K·I·S·S : Just use normal quotes or symbols that any user can access, as opposed to special characters that are not on all keyboards?

I know it looks cool, but ` isn’t an accessible character and isn’t available to all users.

Having said that, if the system can reliably and automatically detect program code segments, do users STILL need to manually delimit it?

And can that preference be reset in preferences?

You can configure in your profile whether links should open in a new tab:
https://meta.discourse.org/my/preferences/interface


Admins can also configure the default for all users with the default other external links in new tab site setting.

2 Likes

Then a lot of things would be formatted as code which shouldn’t. You can use the toolbar to add the formatting.

Then don’t use it at your forum :woman_shrugging:

3 Likes

Maybe I don’t mean what you mean.

‘’ two single quotes are not syntactically valid, so you could use that convention. You can just make up your own convention.

Either way, better a key that can be pressed than one that can’t, IMHO. :slight_smile:

How about a user can define their own code/quote/etc delimiters?

I was more thinking of using the forum as a user… If I am a user of a forum which utilises this feature, can I disable it on my account/profile?

That’d probably nigh impossible to implement. What do you do when two users have conflicting code block definitions?

1 Like

Not an issue. You would simply replace the ` with the user’s preferred character when editing and replace it again when saving, if I am explaining that well enough :confused: Sorry. The backtick would still be used in the back end, just translated for the user in the front-end.

Still, using a more accessible character would be a benefit to everyone.

Maybe a selection of either “`”, “‘’” (two single quotes) or just lines starting with a “}” or a “~” or similar.

We’re currently using “#” for tags, so why not something else equally accessible for lines, blocks or spans of preformatted text?

Backticks are a standard markdown syntax - they’re not Discourse specific. (read more in the commonmark spec).

But, if you want to avoid the backtick character you can indent the code by four spaces, or use the [code] bbcode wrapper:


Source:

    This is 
    some code

Result:

This is
some code

Source:

[code]
This is some code
[/code]

Result:

This is some code
6 Likes

2 posts were split to a new topic: Syntax highlighting for BBCode?