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

Paragraphs/HTML blocks may disappear in HTML block with markdown="1" #153

Open
sylbru opened this issue Apr 22, 2020 · 3 comments · May be fixed by #155
Open

Paragraphs/HTML blocks may disappear in HTML block with markdown="1" #153

sylbru opened this issue Apr 22, 2020 · 3 comments · May be fixed by #155

Comments

@sylbru
Copy link

sylbru commented Apr 22, 2020

The Markdown source below works fine in my app in my local installation, but gives a different output in my app using the deployed app: the nested div ("More problematic stuff?") and the following paragraph are not rendered at all.

Same versions used in both instances:

  • parsedown 1.7.4
  • parsedown-extra 0.8.1
  • PHP 7.3.16

It works if I either:

  • wrap the <table> in a <div> (I’ll do that for now, but still would like to understand what’s happening)
  • remove the <table>, or the <div> following it
  • use Parsedown (not Extra) instead, but then markdown="1" is ignored

I tried to test it on https://parsedown.org/extra/ but apparently it makes the website crash…

<div markdown="1">

First paragraph _using Markdown_. 

<table>
<tbody>
<tr>
<td>
Problematic table?
</td>
</tr>
</tbody>
</table>

<div>
More problematic stuff?
</div>

This disappears.

</div>

This is ok.
@tobias-kuendig
Copy link

A similar problems happens with <tags> inside backticks. It also makes the parsedown.org/extra website crash with a 500 response code:

<section markdown="1">
An example `<style>` tag.
</section>

Passing this section through the parse method breaks later content (a tags are not closed properly, for example).

@lukasleitsch
Copy link

I have the same issue. On my local machine everything works fine. But on the production server the parsing breaks. The local machine and the production server have the same PHP Version.

  • PHP 7.4.8
  • Parsedown 1.8.0-beta-7
  • ParsedownExtra 0.8.0
<div markdown="1">
<ul>
<li>Foo</li>
<li>Bar</li>
</ul>

<ul>
<li>Second Foo</li>
<li>Second Bar</li>
</ul>
</div>

On the production server the second list with Second Foo and Second Bar disappear. On the local machine the second list appears.

<div>
<ul>
<li markdown="1">Foo</li>
<li markdown="1">Bar</li>
</ul>

<ul>
<li markdown="1">Second Foo</li>
<li markdown="1">Second Bar</li>
</ul>
</div>

If only the inner tags have the markdown attributes the second list will be appeared on the production server.

@lukasleitsch
Copy link

I hope I've found the cause. PR is created #155

DOMDocument trim the new line characters in some PHP environments.

bastianallgeier pushed a commit to getkirby/kirby that referenced this issue Sep 1, 2020
Parsedown Extra trims new line characters in some PHP environments.

Parsedown Extra Issue: erusev/parsedown-extra#153
Parsedown Extra PR: erusev/parsedown-extra#155
bastianallgeier pushed a commit to getkirby/kirby that referenced this issue Sep 15, 2020
Parsedown Extra trims new line characters in some PHP environments.

Parsedown Extra Issue: erusev/parsedown-extra#153
Parsedown Extra PR: erusev/parsedown-extra#155
bastianallgeier pushed a commit to getkirby/kirby that referenced this issue Sep 15, 2020
Parsedown Extra trims new line characters in some PHP environments.

Parsedown Extra Issue: erusev/parsedown-extra#153
Parsedown Extra PR: erusev/parsedown-extra#155
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 a pull request may close this issue.

3 participants