GrahamCampbell / Laravel-Markdown

A CommonMark wrapper for Laravel
https://gjcampbell.co.uk/
MIT License
1.32k stars 139 forks source link

Markdown output does not print well if the text continues without any space. #161

Closed lc-salman-ahmad closed 2 years ago

lc-salman-ahmad commented 2 years ago

PHP version: 7.4 Laravel version: 8.4

Description Please help me how can I solve this problem?

As soon as I am doing Markdown::convertToHtml() the output does not print well. It's going out of the box if the text continues without any space. See the output below -

image

Thanks in advance Regard Salman Ahmad

colinodell commented 2 years ago

Hi @lc-salman-ahmad,

It looks like the Markdown is converted to the proper HTML contents, but that your <pre><code> tags do not have any overflow or text wrapping styles applied, which makes it run off the page. Please consider adding those styles to better format the display of those tags.

lc-salman-ahmad commented 2 years ago

Hi @colinodell

Thanks for your quick reply. Yes, Markdown seems to be working fine only the problem is where the text has been written without any space. Below is my <pre> and <pre><code> style for your reference.

pre { display: block; font-size: 87.5%; color: #212529; margin-top: 0; margin-bottom: 1rem; overflow: auto; }

pre code { font-size: inherit; color: inherit; word-break: normal; }

I also tried word-break:break-all; and word-break:break-word but nothing seems to be working.

Please suggest what I need to change into this to fix this issue because I am not an expert in styling CSS.

Regards, Salman

GrahamCampbell commented 2 years ago

Thanks everyone. I'm going to close this out since this is a bit out of scope of the purpose of the issue tracker. I'd encourage you to book some time with a frontend engineer to get this resolved quickly.