Page MenuHomePhabricator

VisualEditor: Converter crashes if a page has a <span> element with a <p> elements
Closed, ResolvedPublic

Description

Wikitext to reproduce:

<span>
[bunch of newlines]
</span>

Parsoid generates <span><p></p></span> for this, but it doesn't mark the span.

Todo:

  • Make the failure a bit more graceful
  • Investigate whether p inside span is legal
  • Investigate other cases where this breakage occurs
  • File bug with Parsoid for proper protection of user-generated tags

Version: unspecified
Severity: normal

Details

Reference
bz42487

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:02 AM
bzimport set Reference to bz42487.
Catrope created this task.Nov 28 2012, 3:02 AM

This content would be in violation of the HTML spec, I believe.

(In reply to comment #1)

This content would be in violation of the HTML spec, I believe.

Yes. But Gabriel argues this is bound to occur in some cases anyway.

Proposed approach: detect these cases (block node inside inline node or annotation node) without crashing, and handle them by backing out and alienating the outer node.

Slight tweak to the approach: it was easier not to back up to the outer node, but instead just inline-alienate the inner node.

https://gerrit.wikimedia.org/r/37172

Resolved in If420ae80ab0777424a9a5517335ef9d0170e87ae