Skip to content

Conversation

@wchargin
Copy link
Contributor

Summary:
Now that every summary has a summary_description field, plugins will
need to serve rendered Markdown to the frontend (assuming that we don't
want to do Markdown rendering in JavaScript, which we don't). This
has security implications (sanitization), so TensorBoard should expose a
function that does the right thing.

An alternative would be to provide a route that provides rendered
Markdown for the summary_description only. This has disadvantages:
(1) it would require at least one extra network roundtrip (plugins must
first request the list of tags, then request the rendered description),
(2) it would induce a FoUC-like state where the tags have been fetched
but their metadata has not; and (3) it would not generalize to plugins
that want to safely render other kinds of Markdown, like the text
plugin.

Test Plan:
Run unit tests, and verify that the text and histogram plugins continue
to work.

wchargin-branch: markdown-to-safe-html

@wchargin wchargin requested review from jart and teamdandelion July 27, 2017 20:24
@wchargin wchargin force-pushed the wchargin-markdown-to-safe-html branch 2 times, most recently from 7568502 to a2cc9d8 Compare July 27, 2017 22:53
Copy link
Member

@chihuahua chihuahua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a nice refactoring that will enable rich-text descriptions of summaries.


warning = text_plugin.markdown_and_sanitize(text_plugin.WARNING_TEMPLATE %
3)
warning = plugin_util.markdown_to_safe_html(text_plugin.WARNING_TEMPLATE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Maybe place the entire argument on the next line and indent it by 4 spaces.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

@wchargin wchargin removed the request for review from teamdandelion July 31, 2017 18:20
Summary:
Now that every summary has a `summary_description` field, plugins will
need to serve rendered Markdown to the frontend (assuming that we don't
want to do Markdown rendering in JavaScript, which we don't). This
has security implications (sanitization), so TensorBoard should expose a
function that does the right thing.

An alternative would be to provide a route that provides rendered
Markdown for the `summary_description` only. This has disadvantages:
(1) it would require at least one extra network roundtrip (plugins must
first request the list of tags, then request the rendered description),
(2) it would induce a FoUC-like state where the tags have been fetched
but their metadata has not; and (3) it would not generalize to plugins
that want to safely render other kinds of Markdown, like the text
plugin.

Test Plan:
Run unit tests, and verify that the text and histogram plugins continue
to work.

wchargin-branch: markdown-to-safe-html
@wchargin wchargin force-pushed the wchargin-markdown-to-safe-html branch from a2cc9d8 to 41809ee Compare July 31, 2017 19:09
@wchargin wchargin merged commit cb929ed into master Jul 31, 2017
@wchargin wchargin deleted the wchargin-markdown-to-safe-html branch August 2, 2017 19:35
arcra added a commit to arcra/tensorboard that referenced this pull request Jul 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants