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

Whitespace between link and code goes lost #174

Closed
noplanman opened this issue Jun 30, 2019 · 1 comment · Fixed by #178
Closed

Whitespace between link and code goes lost #174

noplanman opened this issue Jun 30, 2019 · 1 comment · Fixed by #178

Comments

@noplanman
Copy link

Simple test case:

$this->html_gives_markdown('<a href="ddg.gg">ddg.gg</a> <code>test</code>', '[ddg.gg](ddg.gg) `test`');
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'[ddg.gg](ddg.gg) `test`'
+'[ddg.gg](ddg.gg)`test`'

As you can see, the whitespace between the two elements gets removed.
It basically happens right here:

if ($markdown === ' ') {
$next = $element->getNext();
if (!$next || $next->isBlock()) {
$markdown = '';
}
}

Quick fix would be to also check if it's a code block, or just remove 'code' from the isBlock() method, but that will definitely create some other issue along the line.
I don't know Markdown well enough to guarantee a clean solution, so opted to post an issue here instead 😉

@stale
Copy link

stale bot commented Sep 29, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants