Type the itemtype and ping attributes as URI lists - #385
Merged
Conversation
Both hold URLs, so they belong to Xml.uris_attrib like every other URL-valued attribute, instead of being plain space-separated strings. The reflection case for Xml.uri list comes from #343. Co-authored-by: toastal <toastal@posteo.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The rule is that an attribute holding a URL takes
Xml.uri, andstringotherwise. Two attributes did not follow it.a_itemtypeanda_pingboth took astring listand went throughXml.space_sep_attrib, although the specification says their values are URLs: a set of space-separated tokens, each of which must be a valid URL. They now take anXml.uri listand go throughXml.uris_attrib.Survey of the other URL-valued attributes, for the record:
a_href,a_src,a_cite,a_action,a_formaction,a_manifest,a_poster,a_icon,a_dataanda_itemidalready take anXml.uri, anda_srcsetanda_imagesrcsetgo throughimage_candidate, which is built onuri.a_usemapis left alone: it is a valid hash-name reference (#name), not a URL.Impact
Xml.uris_attribis already part ofXml_sigs.T, so there is nothing new for the implementations to provide.Breaking in theory only. In
Tyxml.Html,Xml.uriisstring, andtyxml_xml.mlbuildsAStrL (Space, …)foruris_attribexactly as forspace_sep_attrib, so neither the accepted values nor the output change. The gain is for implementations whose URI type is abstract, which now get the URI treatment on these two attributes.The reflected parsers are unchanged (
wrap (spaces string)), so the PPX and the JSX syntax behave exactly as before and the existing tests pass without modification.The
Xml.uri listcase inreflect.mlcomes from #343; toastal is credited as co-author on the commit.Tests: 434 green (59 + 52 + 201 ppx + 122 jsx).
dune build @check,dune build @doc,make buildandmake testall pass.