-
Notifications
You must be signed in to change notification settings - Fork 9
Placeholder type #74
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
Placeholder type #74
Conversation
example: "text" | ||
type: string | ||
enum: | ||
- code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code
in image?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, could move that to text
enum: | ||
- text | ||
- hr | ||
- unknown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is unknown
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unknown
is a unknown block type. Allowed in schema for HTML block types html-flatten can't classify, but dropped before solving
- code | ||
- quote | ||
- hr | ||
- unknown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bergie is it guaranteed that unknown
blocks have all the properties of a text
block? If yes, why isn't it just called type: text
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unknown is called unknown
because it is a block type html-flatten doesn't support. We know it has the minimum information available, but don't know how it should be rendered/enriched
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
"$ref": "contentblock.json#/definitions/type" | ||
description: Block type | ||
example: "text" | ||
type: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, trying to understand here these changes to type
: contentblock
still defines what are the possible types of blocks, however each block (e.g. cta
) should define explicitly its type instead of depending on any kind of type from contentblock
. Right?
Does it means that before this change a cta
block could has any type like h1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@automata before this PR, any block would be valid as long as it passed the rules of any block type. So image
would be valid if it can pass text
validations. Using stricter enum causes them to have to validate against the schema of the correct block type(s).
Add definition for the placeholder type, and require contentblocks to match one of the subtypes (which now provide stricter enums on allowed types)