Skip to content

Disallow admonitions in the middle of a block #1093

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

Closed
wants to merge 2 commits into from

Conversation

oprypin
Copy link
Contributor

@oprypin oprypin commented Dec 30, 2020

foo
**foo**
!!! note "Admonition"

In the previous state, the "foo" text would be completely obliterated, but now the admonition will be ignored and all of this will be seen as normal text (with inline processing, of course).

@oprypin
Copy link
Contributor Author

oprypin commented Dec 30, 2020

This is a bug, but it's not obvious what behavior is the correct one.
This PR is the stricter one (perhaps more in the spirit of original Markdown?), and #1092 is an alternative.
One of the two should be chosen.

```markdown
foo
**foo**
!!! note "Admonition"
```

In the previous state, the "foo" text would be completely obliterated, but now the admonition will be ignored and all of this will be seen as normal text (with inline processing, of course).
@waylan
Copy link
Member

waylan commented Dec 30, 2020

As the original regex begins with (?:^|\n) is seems pretty clear to me that the original intent was to not require a blank line before an admonition. This fits quite well with the behavior of headers and other block level elements which provide an obvious start token without needing a blank line.

There is also the possibility that existing documents rely on the existing behavior of not requiring a blank line. If we were to suddenly require one, those documents would break.

Given the above, this is not the correct way to address this issue.

@waylan waylan closed this Dec 30, 2020
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 this pull request may close these issues.

2 participants