-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add markdown sanitization for malicious notebooks (#1315)
* fix: add markdown sanitization for malicious notebooks * *sufficient * fix: check for code block by regex
- Loading branch information
1 parent
ddc0c52
commit e1d5b14
Showing
8 changed files
with
566 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- | ||
title: Test Notebook | ||
marimo-version: 0.0.0 | ||
--- | ||
|
||
```{.python.marimo} | ||
import marimo as mo | ||
``` | ||
|
||
````{.python.marimo} | ||
mo.md(""" | ||
# Code blocks in code blocks | ||
Output code for Hello World! | ||
```python | ||
print("Hello World") | ||
``` | ||
Execute print | ||
```{python} | ||
print("Hello World") | ||
``` | ||
""") | ||
```` | ||
|
||
````{.python.marimo} | ||
mo.md(f""" | ||
with f-string too! | ||
```{{python}} | ||
print("Hello World") | ||
``` | ||
""") | ||
```` | ||
|
||
````{.python.marimo} | ||
mo.md(f""" | ||
Not markdown | ||
```{{python}} | ||
print("1 + 1 = {1 + 1}") | ||
``` | ||
""") | ||
```` | ||
|
||
Nested fence | ||
````text | ||
The guards are | ||
```{python} | ||
```` | ||
|
||
````{.python.marimo} | ||
""" | ||
``` | ||
""" | ||
```` | ||
|
||
````{.python.marimo} | ||
mo.md(""" | ||
Cross cell injection | ||
```python | ||
""") | ||
```` | ||
|
||
```{.python.marimo} | ||
1 + 1 | ||
``` | ||
|
||
```{.python.marimo} | ||
# Actual print | ||
print("Hello World") | ||
``` |
Oops, something went wrong.