Parser is not allowing anchor tags as child of inline elements #2169

Closed
DesignByOnyx opened this Issue Jan 7, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@DesignByOnyx
Contributor

DesignByOnyx commented Jan 7, 2016

I have content which looks like this:

<p><span>Some text with an <a>anchor</a> in it</span></p>

but since the anchor is defined as a block element, it is getting converted to this:

<p><span>Some text with an </span><a>anchor</a> in it</p>

The anchor element is an inline element, but per html5 spec it's the only inline element which allows block level children. The parser should take this into consideration. The "a" tag should be part of the "inline" set of elements (not the "block" group), and conditional logic should be used to prevent the "a" tag from being closed when a block element is encountered.

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Jan 7, 2016

Contributor

This is a reversal of another filed bug. I think the solution is to mark everything as block and require that people close all tags.

Sent from my iPhone

On Jan 6, 2016, at 7:25 PM, Ryan Wheale notifications@github.com wrote:

I have content which looks like this:

Some text with an anchor in it

but since the anchor is defined as a block element, it is getting converted to this:

Some text with an anchor in it

The anchor element is an inline element, but per html5 spec it's the only inline element which allows block level children. The parser should take this into consideration. The "a" tag should be part of the "inline" set of elements (not the "block" group), and conditional logic should be used to prevent the "a" tag from being closed when a block element is encountered.


Reply to this email directly or view it on GitHub.

Contributor

justinbmeyer commented Jan 7, 2016

This is a reversal of another filed bug. I think the solution is to mark everything as block and require that people close all tags.

Sent from my iPhone

On Jan 6, 2016, at 7:25 PM, Ryan Wheale notifications@github.com wrote:

I have content which looks like this:

Some text with an anchor in it

but since the anchor is defined as a block element, it is getting converted to this:

Some text with an anchor in it

The anchor element is an inline element, but per html5 spec it's the only inline element which allows block level children. The parser should take this into consideration. The "a" tag should be part of the "inline" set of elements (not the "block" group), and conditional logic should be used to prevent the "a" tag from being closed when a block element is encountered.


Reply to this email directly or view it on GitHub.

@justinbmeyer justinbmeyer added this to the 2.3.12 milestone Jan 25, 2016

@justinbmeyer justinbmeyer added the bug label Jan 25, 2016

@daffl daffl closed this in #2170 Jan 29, 2016

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