Skip to content
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

Allow images within links in notebooks #1442

Merged
merged 2 commits into from
May 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demos/spatio-temporal/gcn-lstm-LA.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"* [https://github.com/lehaifeng/T-GCN](https://github.com/lehaifeng/T-GCN)\n",
"* [Semi-Supervised Classification with Graph Convolutional Networks](http://arxiv.org/abs/1609.02907)\n",
"\n",
"***Note: this method is applicable for uni-variate timeseries forecasting.***"
"**Note: this method is applicable for uni-variate timeseries forecasting.**"
]
},
{
Expand Down
10 changes: 8 additions & 2 deletions scripts/notebook_text_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ def is_text(elem):
return elem.t == "text"


def is_image(elem):
return elem.t == "image"


SYNTAX_SUMMARY = {
"block_quote": "> text",
"code": "`code`",
Expand Down Expand Up @@ -348,8 +352,10 @@ def simple_inline_formatting(cells):
# not an inline formatting, so not relevant
continue

if all(is_text(child) for child in direct_children(elem)):
# if all of the children are plain text, this is perfect!
if all(
is_text(child) or is_image(child) for child in direct_children(elem)
):
# if all of the children are plain text or images, this is perfect!
continue

# an inline element that contains non-text elements, error!
Expand Down