mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-07 05:15:58 +08:00
Event descriptions are stored as plain text (extracted via `doc.text.strip` from cooked HTML), so any URLs typed by the user were rendered as non-clickable text in the event popup. This adds a `description_html` attribute to the event serializer that linkifies URLs at serialization time via `EventParser.linkify_description`. The method wraps URL matches in `<a>` tags and delegates `rel` attribute handling to `PrettyText.add_rel_attributes_to_user_content`, which respects trust levels, staff status, domain allowlists, and the `add_rel_nofollow_to_user_content` site setting. The raw `description` attribute remains unchanged (plain text) so the edit form continues to show editable text without HTML markup. On the client side, the Description component now receives `@descriptionHtml` and renders it via `trustHTML`. The JS model maps the new `description_html` field from the API response. Also removes `text-align: justify` from the description text style. Ref - t/180829 |
||
|---|---|---|
| .. | ||
| admin | ||
| api | ||
| calendar_subscriptions_spec.rb | ||
| events_controller_spec.rb | ||
| invitees_controller_spec.rb | ||
| site_spec.rb | ||
| sort_event_topics_spec.rb | ||