Can the Unformatted Code Detector be disabled per user?

AI-generated summary

In a discussion about the Unformatted Code Detector on Discourse, users debate whether the feature can be disabled per user. another_username expresses discomfort with content detection and asks if users can disable the warning; Firepup650 clarifies that disabling works per-device, not per-user, referencing a known limitation. another_username questions the accessibility of backticks (`) for code fences, suggesting simpler, universally available characters like double quotes or symbols. They propose letting users define their own delimiters, which Firepup650 deems impractical due to potential conflicts. Moin notes users can set links to open in new tabs via profile preferences, and Moin suggests avoiding the feature if undesirable. another_username reiterates the desire for user-level disablement and accessible delimiters like '', }, or ~. david reminds users that backticks are standard Markdown syntax per CommonMark, but alternatives like 4-space indentation or [code] BBCode are available. The thread highlights usability concerns around code formatting and user control over detection warnings.

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.

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:

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?

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