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

Parsedown Extra: Prevent trimming of new line characters #2773

Merged
merged 2 commits into from
Sep 1, 2020
Merged

Parsedown Extra: Prevent trimming of new line characters #2773

merged 2 commits into from
Sep 1, 2020

Conversation

lukasleitsch
Copy link
Contributor

Describe the PR

Parsedown Extra trims new line characters in some PHP environments. Trimming these characters breaks the parsing of Parsdown Extra in some cases.

I don't know how fast the PR in the Parsedown Extra repo will be merged. Therefore an extra PR for Kirby.

Example

<?php
$text = <<<TEXT
<div markdown="1">
## Headline
<ul>
<li>Foo</li>
<li>Bar</li>
</ul>

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

echo kirbytext($text)
?>

Output on the local machine

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

Output on the production server (Uberspace)

<div>
<h2>Headline</h2>
<ul><li>Foo</li>
<li>Bar</li>
</ul>
</div>

Output on production server with the fix

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

Related issues

Parsedown Extra Issue: erusev/parsedown-extra#153
Parsedown Extra PR: erusev/parsedown-extra#155

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Fixed code style issues with CS fixer and composer fix
  • Added in-code documentation (if needed)

Parsedown Extra trims new line characters in some PHP environments.

Parsedown Extra Issue: erusev/parsedown-extra#153
Parsedown Extra PR: erusev/parsedown-extra#155
@afbora afbora changed the base branch from master to develop August 10, 2020 18:34
@bastianallgeier bastianallgeier merged commit 6d5dbdb into getkirby:develop Sep 1, 2020
@bastianallgeier
Copy link
Member

That's great! Thanks for the fix.

@afbora afbora added the type: enhancement ✨ Suggests an enhancement; improves Kirby label Sep 1, 2020
@afbora afbora added this to the 3.4.3 milestone Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement ✨ Suggests an enhancement; improves Kirby
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants