-
Notifications
You must be signed in to change notification settings - Fork 35
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
Asset mime types #4799
Asset mime types #4799
Conversation
This currently doesn't differenciate between an html piece and an html page. Depending how trustworthy the source is, the former may be rendered inside the widget.
|
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.
This is great!
@@ -46,7 +47,7 @@ const PARSING_REGEX = /{(?<json>{(?:.*?)})}/gim; | |||
|
|||
function isTemplatePart(o: unknown): o is TemplatePart { | |||
if (!o || typeof o !== "object") return false; | |||
return "type" in o && "path" in o && "title" in o; | |||
return "type" in o && "path" in o && "title" in o;`` |
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.
spurious quotes?
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.
yes, reverted
for (const element of data) { | ||
for (const part of element.parts) { | ||
if ("inlineData" in part && part.inlineData.mimeType) | ||
mimeTypes.add(part.inlineData.mimeType); |
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.
can probably exit early here, since we're only taking the first one
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.
I thought we could be doing something smarter in the future, but you are right, replacing with simple return first.
Wiring asset's mimeType to TemplatePart #4605