erusev / parsedown

Better Markdown Parser in PHP
https://parsedown.org
MIT License
14.68k stars 1.12k forks source link

Multi languagal #845

Closed hamedgasemi200 closed 1 year ago

hamedgasemi200 commented 1 year ago

I want to make a module for parsedown to make it multi languagal, but the problem is that parsedown puts multiple lines in a single paragram, and when you set the direction, it's being applied for multiple lines.

<p>
Hello Friend
<br/>
سلام عمر
</p>

I want that Persian text to be in a separate paragraph like below:

<p>Hello Friend</p>
<p>سلام عمر</p>

Are there any solutions? or can this be considered as a bug or something?

hamedgasemi200 commented 1 year ago

Solved it by changing $Block = $this->paragraphContinue($Line, $CurrentBlock); in linesElements to the blow:

   if (isset($CurrentBlock) and $CurrentBlock['type'] === 'Paragraph') {
       $Block = null;
   }