Closed dj357 closed 4 years ago
Have you forgotten to create a new object?
$Parsedown = new Parsedown();
Have you forgotten to create a new object?
$Parsedown = new Parsedown();
Hi jockel09, thanks for the reply. No, that is done higher up, I just didn't include that line of code.
Hi, it looks like the issue is that the table you're wanting to display is an object that spans multiple lines, however you're asking Parsedown to parse the lines individually. To get the result you'd expect, you'd need to read the file into a single string, and then pass that string to Parsedown all in one go.
Hi, it looks like the issue is that the table you're wanting to display is an object that spans multiple lines, however you're asking Parsedown to parse the lines individually. To get the result you'd expect, you'd need to read the file into a single string, and then pass that string to Parsedown all in one go.
Ok that makes so much sense. Confirmed issue resolved.
I have the following table in a .MD file:
When testing this table on the website, it parses correctly:
However, when using Parsedown 1.7.4 or Parsedown 1.8.0-beta-7, neither of them display the table correctly:
I am running PHP v5.6 on an IIS Server. Is this a bug or a configuration issue or a PHP version issue perhaps?
This is the code being used to display the Markdown:
$handle = fopen($path, 'r'); if ($handle) { while (($line = fgets($handle)) !== false) { // process the line read. echo $Parsedown->text($line); } fclose($handle); } else { // error opening the file. echo "Error"; }