33

Currently, tag wiki excerpts are mangled when shown in the tags list. For example, from CodeGolf.SE meta:

new users meta tag rules tag enter image description here

Not even the prefilled status tags are exempt ():

enter image description here

For reference, the excerpts are

For questions related to users that are new to CGCC. (new-users)

Indicates you are proposing new rules or asking for clarification on other ones. (rules)

Questions about what sort of questions are appropriate for PPCG. (scope)

Indicates that a change in functionality is currently under consideration, or needs further investigation. (status-review)

I could find some more examples on other sites, but they're trivial enough to find on any decent sized site.

I understand and agree with the intent behind cropping the displayed tag wiki. Wikis starting with phrases such as

  • "This tag is for ..."
  • "[tag-name] is ..."
  • "The [tag-name] tag is ..."

aren't necessary to show when displaying tag wiki excerpts. However, the currently used regex is awful. So long as any of the phrases are found within the first 50 or so characters, the regex is matched, causing the weird truncations shown. Not only does it display weirdly - making it more confusing for new users to appropriately tag questions - but it also causes editors to find weird phrases in order to avoid these truncations. Finally, one of the matches is literally

(\s(is|are)\s)         # blah blah blah is|are ...

which is just downright stupid. You can't use the words "is" or "are" within the first 40 characters in a tag wiki. I genuinely cannot think of a solid reason behind this. It just seems non-sensical.

For example, on the tag on CGCC, it took me 4 revisions to finally get it to produce a reasonable excerpt, and even then, the formatting isn't great.

Additionally, it completely breaks tags that have "Do not use this tag for ..." in their excerpts, which is counter productive to the entire point of both tag wiki excerpts and these warnings.


The original post about mangling tags is from 2011, over 10 years ago, and the accepted answer by Jeff has a net score of -14. Clearly, this system is outdated and unpopular, and doesn't even achieve its intended goal.

Therefore, please, can we at least modify the regex used to mangle the excerpts? Even better, could we change the script that mangles them to only strip specific words or phrases from the start of excerpts, so that they aren't mangled half-way through, and only remove the first few words?

3
  • 12
    I don't see why it's necessary to replace things like This tag is for... anyway; it just results in inconsistent capitalization and descriptions, and for very little benefit. Removing this altogether seems like the best approach in my opinion. Apr 23 at 0:12
  • 3
    @RedwolfPrograms For larger sites, such as SO or here, scrolling through the list of tags would just become a massive list of "This tag is for..." We can encourage "good" wording of tag edits as much as we like, but the fact remains that the easiest way to start writing one is by using phrases like "This tag is for". Removing set phrases of no more than a few words at the start would cause the lists of tags to be slightly less monotonous, and would likely achieve the same effect Apr 23 at 0:33
  • 9
    I generally just believe that the system should do less of this automatic formatting (or at least make it optional); each community can make their tag wiki excerpts more understandable, the system doing it is just annoying and basically tells every community that they can't be trusted to do things right. Maybe this is helpful for sites where it'd make sense to use "This tag is for..." in the excerpts but they don't want it to flood the tag list, but at least our site and sure many others just have no use for this automatic mangling. Apr 23 at 1:43
15

The regex for clean tag excerpts has been simplified a bit, and now looks like this:

^.{0,40}?
(
(this\stag\s(is)?\s?)  # this tag .. this tag is|about ...
|
(the\s[^\s]+\stag\s(is\s)?)   # the {foo} tag ... / the {foo} tag is ...
|
(the\stag\s[^\s]+(\sis\s)?)     # the tag {foo} ... / the tag {foo} is ...
)

Most importantly, this eliminates the # blah blah blah is|are ... section of the regex, which admittedly did cause some problems in editing out too much (despite the best of intentions).

This solves the problem for the tags highlights from Code Golf Meta, like this one: new-users tag excerpt from Code Golf Meta

Going to mark this as now, and see where this leaves us. If it seems like this has overshot in the other direction, and now there are tag excerpts that are much less usable due to the cleanup regex not covering as many scenarios, then we can reevaluate how we are going to handle this.


A verbose code tag
Regex cleanup goes awry
Maybe cleanup less?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .