Skip to content

Commit 773054d

Browse files
committed
changing url to plotly and image
1 parent 50795b9 commit 773054d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

plotly/presentation_objs/presentation_objs.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,10 @@ def _return_layout_specs(num_of_boxes, url_lines, title_lines, text_block,
861861
title_style_attr, text_style_attr, code_theme)
862862

863863

864+
def _url_parens_contained(url_name, line):
865+
return line.startswith(url_name + '(') and line.endswith(')')
866+
867+
864868
class Presentation(dict):
865869
def __init__(self, markdown_string=None, style='moods'):
866870
self['presentation'] = {
@@ -951,7 +955,14 @@ def _markdown_to_presentation(self, markdown_string, style):
951955
if not inCode and line != '```':
952956
if len(line) > 0 and line[0] == '#':
953957
title_lines.append(line)
954-
elif line.startswith('url('):
958+
elif (_url_parens_contained('Plotly', line) or
959+
_url_parens_contained('Image', line)):
960+
if line.startswith('Plotly(') and 'plot.ly' not in line:
961+
raise exceptions.PlotlyError(
962+
"You are attempting to insert a Plotly Chart "
963+
"in your slide but your url does not have "
964+
"plot.ly in it."
965+
)
955966
url_lines.append(line)
956967
else:
957968
# find and set transition properties

0 commit comments

Comments
 (0)