Topics with period at end of abbreviations don't keep the period

Reproduce: Create a topic with a period-laden abbreviation at the end of it, e.g.:

I like Civilized Discourse Construction Kit, Inc.

Expected behavior: The topic title is rendered exactly as the user entered it (see above).

Actual behavior: The period at the end doesn’t persist, e.g.:

I like Civilized Discourse Construction Kit, Inc

This topic was created with a period at the end, too, but you’ll never know. Period.

1 Like

It’s not a bug, it’s a feature:

https://github.com/discourse/discourse/blob/master/lib/text_cleaner.rb#L33-L34

1 Like

Ha ha, nice joke. :wink:

No, really. That piece of regex specifically removes trailing periods from post titles… no joke at all.

If you want to disable this, turn off the title_prettify setting.

Note that this will also turn off other features, such as deduplicating exclamation marks and question marks, downcasing all-uppercase titles, capitalizing the first letter of the title,

https://github.com/discourse/discourse/blob/master/lib/text_cleaner.rb#L8-L17

The bug is that it’s not an “unnecessary” period or an “extra . at end” as the so-called feature describes. It’s a single, very necessary period.

I’ll turn off the setting, of course, but that doesn’t mean this isn’t a bug.

1 Like

If it is a bug, it is at least dependent on the locale.

In German, for instance, “the period does not occur after detached (from the remaining text clearly separated) lines” (translated from Duden, Regel 153), and regarding English there’s even a topic at StackExchange about it that indicates that titles generally should not end with a full stop.

2 Likes

And from the Chicago Manual of Style (a bit more authoritative on grammar than Stack Exchange :smile:) … “[a]n abbreviation that ends with a period must not be left hanging without it”. (Which is actually the issue in the example above.)

Fair point, but that’s a different bug report:

“Text cleaner should not remove periods from abbreviations even at end of title”

Edited title of this post to refer to the original example.

Even the despised mobile OS autocorrect allows users to recover from its “software knows best” suggestions of what’s right. Why doesn’t Discourse?

This feature already exists, just disable topic title prettify… nothing left to discuss.