Jump to content

Talk:Parsing/Notes/Section Wrapping

Add topic
From mediawiki.org

Unclosed tag

[edit]

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


The "Consistency Options" section talks about an unclosed </div> tag. Isn't that more an unopened </div> tag? BSitzmann (WMF) (talk) 19:36, 13 July 2017 (UTC)Reply

Yup. Thanks. Changed that to unmatched </div> tag. SSastry (WMF) (talk) 04:37, 15 July 2017 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

header elements?

[edit]

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


Just to confirm that we don't need HTML5 header elements inside section. Is this correct? I just want to make sure that this won't change since it would change the way MCS would parse the HTML to get the section text for the JSON endpoint. BSitzmann (WMF) (talk) 16:36, 17 July 2017 (UTC)Reply

No, there isn't any plan to introduce those. SSastry (WMF) (talk) 16:38, 17 July 2017 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Use of section tags with PHP section edit API

[edit]

The current text seems to assume that DOM sections would be used directly against wikitext section edit APIs. Is this actually needed or desired? Gabriel Wicke (GWicke) (talk) 21:44, 19 July 2017 (UTC)Reply

Yes, it does. Why should we introduce different notions of sections, one for reading and one for editing? Do note that for the most common use case where we don't have malformed sections in wikitext, there are no conflicts between the two notions. SSastry (WMF) (talk) 03:25, 20 July 2017 (UTC)Reply
In edge cases, current edit sections don't necessarily align with DOM structures. Unless you are willing to break up DOM structures (which has many issues), there will be incompatibilities with the old-style section edit API.
Rather than defining sections around edge case bugs in the current section edit functionality, I think it makes a lot more sense to focus on product needs and user expectations. We can update APIs to respect DOM sections, rather than limiting DOM sections by old API issues. Gabriel Wicke (GWicke) (talk) 22:39, 20 July 2017 (UTC)Reply
Understood.
The plan (proposal 1) is indeed to add sections around DOM structures in those cases, but to then disable editability for those with the current save API. When the API changes or when we decide to enforce well-formedness of sections / templates / etc, editability can be enabled. SSastry (WMF) (talk) 22:48, 20 July 2017 (UTC)Reply
I had temporarily proposed one such different save API based on source offsets, but then quickly realized that it was a broken idea and removed it.
So, we are on the same page here as far as I can tell. The primary difference from what you have is to add a mapping with the MediaWiki section numbering that ensures that section tags can be used by editing clients and have the guarantee that they won't corrupt the page if they use the section edit API. SSastry (WMF) (talk) 22:52, 20 July 2017 (UTC)Reply
We already offer editing of DOM sections in the REST API. The main issue right now is that those "sections" are too fine-grained (all children of body), which is one of the issues the <section> wrapping discussed here should resolve. Gabriel Wicke (GWicke) (talk) 13:51, 21 July 2017 (UTC)Reply

Page is a sequence of sections" doesn't map well to nested section tags?

[edit]

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


The current page text states:

"TODO: "Page is a sequence of sections" doesn't map well to nested section tags? It also doesn't match the "styled Template" mechanism being introduced, where styled templates would deliberately introduce
tags outside of/around a <section>." This does not seem to be an accurate characterization of the implementation in https://github.com/wikimedia/parsoid-dom-utils. Take a look at the test cases in https://github.com/wikimedia/parsoid-dom-utils/blob/master/test/sections.yaml. Nested section tags as well as
wrappers are supported. Nested sections receive their own nested <section> tags. Div wrappers are wrapped into a section of their own, effectively expanding the scope of the outermost section to wrap the entire
. Gabriel Wicke (GWicke) (talk) 21:50, 19 July 2017 (UTC)Reply
C.Scott was responding to your review comment I posted from the gerrit review. He may not have seen the implementation. I'll just edit that out. SSastry (WMF) (talk) 03:22, 20 July 2017 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.