PlaidWeb / Publ

Flexible publishing system for the web
http://publ.beesbuzz.biz/
MIT License
40 stars 4 forks source link

Improve tag normalization #432

Closed fluffy-critter closed 3 years ago

fluffy-critter commented 3 years ago

Summary

Improve the way that tags are normalized and displayed.

Fixes #430. Fixes #431

Detailed description

When tags are stored in the database, they use the slugified form of the tag name, instead of simply casefolding it. This way, tags such as neko and ねこ are treated equivalently, and punctuation is also folded away (e.g. dance dance revolve and dance, dance, revolve are also equivalent). This has the side effect of also making view URLs always 7-bit-clean, albeit in a reductively Anglicizing way.

When tags are displayed from view.tags (or anything else which is processed through utils.TagSet), it now consults the database for the display name of the tag. This uses the most recently-indexed denormalization of the tag.

This does not change the display of tags in entry.tags (by design).