It seems like the content you are trying to display in the modal is being output as plain text, including the HTML tags, rather than being rendered as HTML. To fix this, you should ensure that the content is not being escaped when output to the view.
Here's how you can do it:
- If you are using Blade templates in Laravel, you should use the
{!! !!}syntax to output the content as raw HTML. For example:
<!-- Inside your modal content view -->
<div class="modal-content">
{!! $terms !!}
</div>
- Make sure that when you pass the content to the view, you are not escaping it. For example:
// In your controller or wherever you are preparing the view
return view('forms.components.terms', ['terms' => $termsContent]);
- If you are using a JavaScript framework or library to handle your modals, ensure that you are inserting the content as HTML and not as text. For example, if you are using jQuery, you should use
.html()instead of.text():
// Using jQuery to set the modal content
$('.modal-content').html(modalContent);
By ensuring that the content is being treated as HTML and not plain text, the browser will render the tags properly, and your paragraphs should display as expected. Remember to sanitize your content if it's coming from user input to prevent XSS attacks.