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

Codeblock after paragraph #78

Open
pmatos opened this issue May 10, 2019 · 1 comment
Open

Codeblock after paragraph #78

pmatos opened this issue May 10, 2019 · 1 comment

Comments

@pmatos
Copy link

pmatos commented May 10, 2019

If I use a codeblock like this:

Here's a codeblock:
```racket
(define foo 1)
```

it doesn't work because it expects a newline before ```. Why is this?

This works

Here's a codeblock:

```racket
(define foo 1)
```
@greghendershott greghendershott transferred this issue from greghendershott/frog May 10, 2019
@greghendershott
Copy link
Owner

(I transferred this issue from frog to markdown. I haven't tried doing that before on GitHub, so hopefully it worked correctly.)

Some markdown parsers expect a clearer end-of-paragraph before being ready to parse backticks as code-blocks. Mine is in that camp. A sampling of others.

There is some potential ambiguity because backticks are also used for inline <code> elements, too. Including using multiple backticks, which is necessary to escape a backtick. In other words:

This is ```inline code with a ` in the middle``` right here.

Renders as:

This is inline code with a ` in the middle right here.

You don't need three in this example. Just two would suffice. But the parser needs to handle three.

Of course it's not completely ambiguous because some parsers do the right thing that you want.

However I'm reluctant to open the hood on the markdown parser. It's been N years since I really worked on it. I'd be even more likely, than usual, to introduce some other bug in the process of fixing this.

So I'll leave this open as worthwhile to do. And someday I can tackle it as part of a batch, when I have a block of time to reload my brain and hopefully do it effectively. But in the meantime if you could add the extra blank line, as a work-around, that at least will make your markdown "more portable" (if there even is a thing when it comes to markdown).

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

No branches or pull requests

2 participants