File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ A Sphinx extension that provides utilities for embedding JupyterLite in your doc
1212 :width: 100%
1313 :height: 600px
1414
15- print(' Hello from a JupyterLite console!' )
15+ print(" Hello from a JupyterLite console!" )
1616
1717.. toctree ::
1818 :caption: Installation
Original file line number Diff line number Diff line change 44
55from pathlib import Path
66
7+ from urllib .parse import quote
8+
79import subprocess
810
911from docutils .parsers .rst import directives
@@ -58,12 +60,14 @@ def __init__(
5860 def html (self ):
5961 replite_options = self ["replite_options" ]
6062
61- code_lines = [line .strip (). replace ( " " , "%20" ) for line in self ["content" ]]
62- code = "%0A " .join (code_lines )
63+ code_lines = [line .strip () for line in self ["content" ]]
64+ code = "\n " .join (code_lines )
6365
6466 replite_options ["code" ] = code
6567
66- options = "&" .join ([f"{ key } ={ value } " for key , value in replite_options .items ()])
68+ options = "&" .join (
69+ [f"{ key } ={ quote (value )} " for key , value in replite_options .items ()]
70+ )
6771
6872 return (
6973 f'<iframe src="{ JUPYTERLITE_DIR } /repl/index.html?{ options } "'
You can’t perform that action at this time.
0 commit comments