Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

12685 use markdown for custom fields added to form #13828

Merged
merged 3 commits into from
Sep 20, 2023

Conversation

arthanson
Copy link
Collaborator

Fixes: #12685

Renders custom field description (for help text) using markdown for forms. Did the escape first so it catches html and just process markdown afterwards.

Copy link
Contributor

@kkthxbye-code kkthxbye-code left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not match the markdown supported elsewhere in netbox. Easiest way to demonstrate is to set the description to <strong>test</strong>.

How it's displayed in different parts of the UI:

Custom field object view:
image

Target object view:
image

Target object edit view:
image

All other places we render markdown is done with from utilities.templatetags.builtins.filters import render_markdown.

When setting the description to **test** the custom field object view and the target object edit view works, but not the target object view:

Custom field object view:
image

Target object view:
image

Target object edit view:
image

The cause is that the PR doesn't modify this:

class="mdi mdi-information text-primary"
data-bs-toggle="tooltip"
data-bs-placement="right"
title="{{ field.description|escape }}"

@jeremystretch jeremystretch merged commit 6e4b4a5 into develop Sep 20, 2023
8 checks passed
@jeremystretch jeremystretch deleted the 12685-custom-field-markdown branch September 20, 2023 18:06
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Markdown in custom field descriptions not rendered in object edit view
3 participants