Page MenuHomePhabricator

Annotation nesting detection is not well handled when annotations span over an attribute
Closed, DeclinedPublicBUG REPORT

Description

The current handling of attributes doesn't allow for good annotation nesting detection:

  • the start tag is an arbitrary tag with a typeof attribute, and not a <meta> tag
  • the end tag disappears if it's well-nested in the attributes, but not if it is inserted as a later tag.

This has the following consequences:

  • nested annotations are not detected if the first opening tag is in an attribute:
$ echo '[[<tvar>plop|plop]] <tvar>nested</tvar> hello</tvar>' | php ./bin/parse.php --wt2wt
[[<tvar>plop|plop]] <tvar>nested</tvar> hello</tvar>
  • if the opening tag is outside an attribute and the closing tag is inside an attribute, the corresponding annotation is not seen as closed, which can lead to bad removal of (actually non-)nested annotations:
$ echo '<tvar>[[plop</tvar>|plop]] <tvar> not nested</tvar>' | php ./bin/parse.php --wt2wt
<tvar>[[plop</tvar>|plop]]  not nested

Whether we want to handle these corner case situations in Parsoid is debatable (since the markup wouldn't be recommended either), but we may want to consider linter rules for them.

Related Objects

StatusSubtypeAssignedTask
OpenReleaseNone
OpenNone
OpenNone
OpenNone
OpenFeatureNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
ResolvedEsanders
OpenFeatureNone
Resolvedihurbain
Resolvedihurbain
ResolvedBUG REPORTihurbain
DeclinedBUG REPORTihurbain

Event Timeline

ihurbain added a subscriber: ssastry.

Declining this after discussion with @ssastry - this is not syntax we want to support, and this is also not something I remember seeing in the wild - I think it's more of a "what if" test scenario than a legitimate use case.