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

Wrong parser #174

Closed
ovr opened this issue May 17, 2014 · 13 comments
Closed

Wrong parser #174

ovr opened this issue May 17, 2014 · 13 comments

Comments

@ovr
Copy link

ovr commented May 17, 2014

Please fix it

@erusev
Copy link
Owner

erusev commented May 17, 2014

I don't understand.

@kminchev
Copy link

@ovr, you need space between '#' and text, ie. # 316

@ovr
Copy link
Author

ovr commented May 17, 2014

@erusev @kminchev
i create list of bugs
-#issue

bug issue parsed to header

@hkdobrev
Copy link
Contributor

I think this issue is about the following:

- #notheading

In Markdown PHP 1.3 and the original Dingus the result is:

<ul>
<li>#notheading</li>
</ul>

And in Parsedown:

<ul>
<li>
<h1>notheading</h1>
</li>
</ul>

The spec says:

Atx-style headers use 1-6 hash characters at the start of the line, corresponding to header levels 1-6

The heading should start only if the # character is at the start of the line. This introduces the problem that you cannot easily put a heading inside lists.

However headings in blockquotes work everywhere even though the # character is not at the start of the line.

@ovr You could use \# as a workaround for now.

@erusev
Copy link
Owner

erusev commented May 18, 2014

@hkdobrev

The heading should start only if the # character is at the start of the line. This introduces the problem that you cannot easily put a heading inside

Should this also not output a heading?

> # Heading
>
> Here'a paragraph.

@hkdobrev
Copy link
Contributor

@erusev That's exactly what I was saying:

However headings in blockquotes work everywhere even though the # character is not at the start of the line.

I meant that for Dingus and Markdown PHP as well.

@hkdobrev
Copy link
Contributor

hkdobrev commented May 18, 2014

Basically in Markdown it does not make sense to put headings inside lists. Headings are meant to be separators of the content.

The blockquotes are an exception, because you should be able to quote any other Markdown text (which could contain headings).

If you want to put headings inside lists items so much (which is valid in terms of HTML IMHO) you could use:

 - <h1>This is a heading inside a list item</h1>

@erusev
Copy link
Owner

erusev commented May 19, 2014

I don't disagree.

@ovr
Copy link
Author

ovr commented May 25, 2014

I agree with @hkdobrev
Main problem H1 in li
For example i see normal variant in github markdown parser

@apfelbox
Copy link
Contributor

Should this also not output a heading?

# Heading

Here'a paragraph.

Well, the heading is at the beginning of the line (relative to the blockquote), so yes, <h1> - and that's how I would implement it.

@svivian
Copy link

svivian commented Jun 9, 2016

I'm also suffering from this issue. Any chance this will be fixed soon?

@aidantwoods
Copy link
Collaborator

When #553 is sorted, the new internal features from #433 could be used by an extension to disable nesting of certain select parser elements. I would probably vote against this being default though, since it goes against the commonmark spec.

@aidantwoods
Copy link
Collaborator

#433 was included in version 1.7.1 so I think that could be used to solve this in an extension relatively easily. Please reopen if that is not the case though :)

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

No branches or pull requests

7 participants