mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-06 21:30:25 +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 |
||
|---|---|---|
| .. | ||
| discourse_post_event | ||
| calendar_first_day_of_week_spec.rb | ||
| calendar_settings_validator_spec.rb | ||
| calendar_spec.rb | ||
| group_timezones_spec.rb | ||
| users_on_holiday_spec.rb | ||