Skip to content

Conversation

@Suyog241005
Copy link
Contributor

Reasons for making this change

This PR implements the ability to render markdown in help text fields across all themes by introducing a new ui:enableMarkdownInHelp flag, similar to the existing ui:enableMarkdownInDescription functionality.

-Updated all theme packages to support markdown in help text

Fixes 4601

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests. I've run npx nx run-many --target=build --exclude=@rjsf/docs && npm run test:update to update snapshots, if needed.
    • I've updated docs if needed
    • I've updated the changelog with a description of the PR
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

@Suyog241005 Suyog241005 force-pushed the fix/#4601-added-UiSchema-enableMarkdownInHelp-flag branch 2 times, most recently from 6e9390a to e7391fd Compare November 6, 2025 13:08
@Suyog241005
Copy link
Contributor Author

Hi @heath-freenome , all the test cases for this PR have passed successfully. Could you please review it when you get the chance and let me know if any further changes or improvements are needed before merging?

@Suyog241005 Suyog241005 force-pushed the fix/#4601-added-UiSchema-enableMarkdownInHelp-flag branch from e7391fd to b337908 Compare November 6, 2025 18:46
Copy link
Member

@heath-freenome heath-freenome left a comment

Choose a reason for hiding this comment

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

Also, please add test to formTest.tsx in snapshot-tests to verify the markdown help

@heath-freenome heath-freenome changed the title added the ui:enableMarkdownInHelp flag in UiSchema Feature: added the ui:enableMarkdownInHelp flag in UiSchema Nov 6, 2025
@Suyog241005 Suyog241005 force-pushed the fix/#4601-added-UiSchema-enableMarkdownInHelp-flag branch 2 times, most recently from 398ab33 to 17938e6 Compare November 7, 2025 13:16
@heath-freenome
Copy link
Member

@Suyog241005 If you could respond to my questions I've left in the review, I'd appreciate it

@Suyog241005
Copy link
Contributor Author

@heath-freenome I’ve updated the changelog as requested. Please let me know if anything else needs adjustment.

Copy link
Member

@heath-freenome heath-freenome left a comment

Choose a reason for hiding this comment

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

A few more changes

@Suyog241005 Suyog241005 force-pushed the fix/#4601-added-UiSchema-enableMarkdownInHelp-flag branch 2 times, most recently from c918d74 to 472829c Compare November 8, 2025 14:46
@Suyog241005
Copy link
Contributor Author

Hi @heath-freenome, I’ve implemented all the requested changes.

Could you please review the latest updates when you get a chance?

return (
<FormHelperText component='div' id={id}>
{help}
<FormHelperText id={helpId(fieldPathId)} style={{ marginTop: '5px' }}>
Copy link
Member

Choose a reason for hiding this comment

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

Please restore the component='div'

Suggested change
<FormHelperText id={helpId(fieldPathId)} style={{ marginTop: '5px' }}>
<FormHelperText component='div' id={helpId(fieldPathId)} style={{ marginTop: '5px' }}>

@Suyog241005 Suyog241005 force-pushed the fix/#4601-added-UiSchema-enableMarkdownInHelp-flag branch 2 times, most recently from d1e773a to 4b3bca1 Compare November 9, 2025 18:10
Copy link
Member

Choose a reason for hiding this comment

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

You can delete this entire file since you now have FieldHelpTemplate.

Comment on lines 18 to 26
const id = helpId(fieldPathId);

return (
<div id={id} className='ant-form-item-extra'>
<div className='help-block'>
{typeof help === 'string' ? help : <RichHelp help={help} registry={registry} uiSchema={uiSchema} />}
</div>
</div>
);
Copy link
Member

Choose a reason for hiding this comment

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

Is the extra div and ant-form-item-extra required? And also, doesn't the RichHelp already handle the help is string case?

Suggested change
const id = helpId(fieldPathId);
return (
<div id={id} className='ant-form-item-extra'>
<div className='help-block'>
{typeof help === 'string' ? help : <RichHelp help={help} registry={registry} uiSchema={uiSchema} />}
</div>
</div>
);
return (
<div id={helpId(fieldPathId)} className='help-block'>
<RichHelp help={help} registry={registry} uiSchema={uiSchema} />
</div>
);

return (
<FormHelperText component='div' id={id}>
{help}
<FormHelperText component={'div'} id={helpId(fieldPathId)} style={{ marginTop: '5px' }}>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<FormHelperText component={'div'} id={helpId(fieldPathId)} style={{ marginTop: '5px' }}>
<FormHelperText component='div' id={helpId(fieldPathId)} style={{ marginTop: '5px' }}>

@Suyog241005 Suyog241005 force-pushed the fix/#4601-added-UiSchema-enableMarkdownInHelp-flag branch from 4b3bca1 to 7cd0eb1 Compare November 9, 2025 18:26
…estored text-danger logic in Bootstrap FieldHelpTemplate & updated core test to expect div.help-block instead of p.help-block
@Suyog241005 Suyog241005 force-pushed the fix/#4601-added-UiSchema-enableMarkdownInHelp-flag branch from 7cd0eb1 to 6910c5c Compare November 9, 2025 18:28
@Suyog241005
Copy link
Contributor Author

@heath-freenome , i have made the changes as per instructed

@heath-freenome heath-freenome merged commit 619eead into rjsf-team:main Nov 9, 2025
5 checks passed
@heath-freenome
Copy link
Member

@heath-freenome , i have made the changes as per instructed

Thanks for all your hard work!

@Suyog241005
Copy link
Contributor Author

@heath-freenome , i have made the changes as per instructed

Thanks for all your hard work!

The pleasure is mine 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a new UiSchema ui:enableMarkdownInHelp flag

2 participants