-
Couldn't load subscription status.
- Fork 20
Proposal: refactor the processing of meta elements #40
New issue
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
base: main
Are you sure you want to change the base?
Conversation
|
Thanks, though honestly, I feel like this is too complicated. I think the less surprising (for users) and easier to maintain (for devs) path is keeping things very simple and flat, with no complicated heuristics and no overriding behavior by default. And for overridability, introduce an opt-in |
This is not (always) correct. Open Graph declares arrays using multiple
|
|
@yume-chan Yes, you are right, I forgot to consider the Open Graph case. Now that Open Graph has a certain format for What do you think? Your ideas are welcome. By the way, it looks like this project is no longer active and I'm not quite sure when this proposal will be adopted by the maintainers... |
Maybe Open Graph is too complex that it worths its own package. Open Graph arrays make it impossible for the heuristics to decide whether multiple Some user input, like #39, might be required. Then the dedicated Open Graph package can choose to override
I hope it's not 😞. However npm overrides is always an option. |
I agree with this. There is really no need to re-implement the parsing logic of Open Graph tags in this project. |
As I said in this issue, I've rearranged the attributes that may appear on the
metaelement, as well as new test cases for themetaelement.In the following, I have bolded some of the content to be discussed.
Please review it when you are free. @DaniGuardiola is also welcome to review it together. Any suggestions are very welcome.
Attributes (spec)
name: Metadata namehttp-equiv: Pragma directivecontent: Value of the elementcharset: Character encoding declarationmedia: Applicable mediaitemprop: Microdata, may appear on any HTML elementAdditional attributes (spec)
property: Extended attribute by RDFa, commonly used in the Open Graph protocolRules
name,http-equiv,charset, anditempropattributes must be specified.name,http-equiv, oritempropis specified, then thecontentattribute must also be specified. Otherwise, it must be omitted.charsetattribute is present, its value must be an ASCII case-insensitive match for the string"utf-8".metaelement with acharsetattribute per document.mediaattribute says which media the metadata applies to.Additional rules
propertyis specified, then thecontentattribute must also be specified. (not for sure, but it seems to be true)nameis not specified butpropertyis specified, then thepropertyattribute should be treated asnameattribute. (Do users need to be warned about this compatibility process?)nameandpropertyare specified, then thepropertyattribute should be the same asnameattribute. (Does this rule should be added to simplify processing?)Test cases