Page MenuHomePhabricator

Move info about template-affected attributes from meta tags into data-mw
Closed, ResolvedPublic

Description

We currently use meta tags to mark up template-affected attributes:
http://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Templates_in_attributes

This turned out to be problematic for several reasons:

These meta tags can end up in foster-parentable positions for inputs like this:

<table><tr title="{{echo|foo}}"></tr></table> They can end up outside of an extension fragment, which makes it hard to reuse fragments. This currently blocks https://gerrit.wikimedia.org/r/#/c/65575/ We have been discussing moving this information to data-mw ever since we added that as a public interface. Subbu has sketched a possible encoding in https://gist.github.com/subbuss/6092148/raw/e153a444b6e252d9eebd690e996e28cdbb859df7/gistfile1.txt We should work this out further in http://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Templates_in_attributes and implement the resulting spec. An issue to consider is the interaction between template content editing (http://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Template_content) and templated attributes. For simple cases like echo '[[{{echo|foo}}]]' | node parse, we currently only add mw:ExpandedAttrs/Transclusion info. For echo '<div title="{{echo|foo}}">{{echo|</div>}}' | node parse however we add both mw:Transclusion and mw:ExpandedAttrs/Transclusion. The templated attribute can already be edited as wikitext in the mw:Transclusion interface (data-mw.parts). We might want to omit the attribute interface here in favor of the general template-affected content interface. Fragment reuse is another issue to consider. We currently don't reuse attribute expansions. These are relatively rare and cheap, so this might be ok for now. We should however choose a representation that makes it easy to add caching for these later. Currently the VisualEditor completely ignores information about template-affected attributes, so no deployment coordination will be required as long as the mw:Transclusion interface does not change. -------------------------- **Version**: unspecified **Severity**: normal

Details

Reference
bz52913

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:50 AM
bzimport added a project: Parsoid-DOM.
bzimport set Reference to bz52913.

Meta tags in foster-parentable positions aren't really an issue anymore.

This was fixed by 283bfd554bf1, so closing this bug. Please reopen if there is something we overlooked.