Can I disable some autoformatting for posts? (i.e., double hyphen to em dash)

I have a forum where users post data in from programs to share and discuss that is in the form of encoded strings. We are having the problem where consecutive hyphens are turning into em dashes.

For users that are aware of the issue, they can solve it by putting their encoded strings in preformatted text blocks (blockquotes have same issue and auto-convert). However, newer users and those less technical savvy are having trouble and, after simply pasting their encoded strings, end up with dash-converted strings that cause error when importing them back into the original program after copy-paste. This then results in significant back and forth posting and confusion within the topic which destroys the original post’s intent.

Long story short, can I somehow as the admin disable double hyphen to em dash auto-formatting?

E.g., typing A-- raw in the post autoformats to A–, which then copy-pastes back as A–.

Thank you,
Brett

You can disable this auto-formatting with this setting. Unfortunately, you can’t choose what to disable.

However, if you want to keep typography rules but disable em-dash, you could use the following trick with replace words:

If you do the latter, note that:

  • Existing posts will be required to be edited or rebuilt
  • You might want to enable this setting if you want to use regular expressions to narrow down the usage:
    image
4 Likes

And one small not-so-beautiful trick more: replace — - to - - (well, that is not right either) because then you should could (is that even english :flushed: ) save skin of Apple users, I reckon. At least i-devices will use — everywhere no matter if em-dash is disabled on side of Dsicourse.

Honestly said — I’ve never done that, but because I have to use copy&paste, thanks to Apple, for same reason, and it works then should replacing work same way if there is need to save em-dash.

There was some easier trick to achieve same, but I can’t remember what it was and who guided me… I whined same thing, but for me the reason was markdown tables.

1 Like

You really want to train people to put that stuff in code blocks, but these site settings might help: /admin/site_settings/category/posting?filter=highlight.

What do your code blocks look like? Is the site public?

1 Like

The site is backgammonforums.com

The text in question comes in the form of XGIDs that encode the board state and score of a backgammon game/match. For example, here is the ID of a starting position for a match to 7 with Black winning the opening roll with a 65 to play:

XGID=-b----E-C---eE---c-e----B-:0:0:1:65:0:0:0:7:10

And here if I just paste it raw (notice issues between the C/e and later E/c):
XGID=-b----E-C—eE—c-e----B-:0:0:1:65:0:0:0:7:10

Do they always start with XGID=?

The ones from eXtreme Gammon program do but we also have users posting GNU Backgammon IDs. They do not have a prefix. E.g.:

jM/gDQDYzeAJIA:EQFvAAAAAAAA

… but these also don’t use hyphens so don’t suffer from the same markdown auto-corrections

I think that a theme component might be able to detect those and make them into code blocks.

But the brute force worst case solution is to have a bunch of moderators editing posts for people.

1 Like

In general, when you edit a post like suggested, do you leave a note or post a reply? Do users ever get upset?

Back in the day, one of the co-founders here would regularly fix up my typos.

For something like fixing formatting, I think people would be happy. The bigger question is whether they will be able to discern from the edit just what it was that you did so that they’ll know what to do next time.

Here, TL3 users can edit titles and categories. It’s rare that I’ve had someone complain.

What’s appropriate for your community, I can’t guess. Maybe they’ll think “Cool! Now I know how todo that” or maybe they’ll think something else.

4 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.