We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expand(..., extractAllScripts)
As described in Process HTML section of the specification, it is described how expand() behaves on HTML documents with extractAllScripts option.
expand()
extractAllScripts
false
object
array
null
true
This means that the output type of expand() deterministically depends on its input parameters.
What if we could split expand() into two separate functions?
expand_all()
Over time, expand() might be updated: it will no longer accept extractAllScripts option at all and it will only parse one <script> in the document.
<script>
P. S. This will be handy for YAML-LD to expand_all() multiple documents in a stream.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
As described in Process HTML section of the specification, it is described how
expand()
behaves on HTML documents withextractAllScripts
option.false
then it will return a JSON-LD document (might be anobject
, anarray
, or perhaps anull
);true
thenexpand()
returns necessarily anarray
.This means that the output type of
expand()
deterministically depends on its input parameters.What if we could split
expand()
into two separate functions?expand()
will behave as it is behaving now, but it will print a deprecation message whenextractAllScripts
istrue
;expand_all()
will not acceptextractAllScripts
option and will always output an array. It will parse all scripts in a document.Over time,
expand()
might be updated: it will no longer acceptextractAllScripts
option at all and it will only parse one<script>
in the document.P. S. This will be handy for YAML-LD to
expand_all()
multiple documents in a stream.The text was updated successfully, but these errors were encountered: