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

Fix BREAD rich text display issue #5840

Open
wants to merge 4 commits into
base: 1.6
Choose a base branch
from

Conversation

ModulesSoft
Copy link

Pull Request: Fix Showing HTML Elements and HTML Entities in BREAD views

Description

This pull request resolves the issue where HTML tags and entities were returned for rich-text values by the 'index', 'show', 'order', and 'relation' BREAD methods, as well as a fix for values displayed in relationship.blade for better 'edit' view. 🛠️
The problem led to an unformatted and confusing user experience. 🔍

Changes Made

  • Added stripTagsFromObject(), and stripTagsFromCollection() methods to VoyagerBaseController class.
  • Called the mentioned methods in the 'index', 'show', 'order', and 'relation' methods for $dataTypeContent.
  • Added strip_tags() and html_entity_decode() PHP methods to the values in the relationship.blade view for the remaining unformatted data being shown.
  • Finally, ensured that HTML elements and entities are now displayed as rendered content, improving the user experience. ✨👀

How to Test

  1. Navigate to a page with a rich text field (of itself or its relations) in browse, order, show, etc. views.
  2. Verify that HTML tags and entities are now removed, rather than being displayed as raw code.
  3. Confirm that the rich text content appears as intended and is easy to read.

Additional Notes

This fix enhances the user experience by ensuring that rich text preview is correctly displayed in BREAD views.
Your review and feedback are highly appreciated. 🙏

@ModulesSoft
Copy link
Author

Following is a snapshot of the problem for one case.

Screenshot 2024-03-16 at 8 50 24 AM

@ModulesSoft ModulesSoft changed the title Fix/BREAD rich text display issue Fix BREAD rich text display issue Mar 31, 2024
berkanumutlu added a commit to berkanumutlu/laravel-voyager that referenced this pull request May 29, 2024
- Admin > Html tag içeren kayıtların browse sayfalarında düzgün gösterişmesi sağlandı. (thedevdojo/voyager#5840)
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.

None yet

1 participant