This repository has been archived by the owner on Jun 4, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #916 from AnnMarieW/markdown-html
Allow HTML content in Markdown cells
- Loading branch information
Showing
4 changed files
with
51 additions
and
2 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,38 @@ | ||
import dash | ||
from dash_table import DataTable | ||
|
||
|
||
def get_app(markdown_options): | ||
|
||
app = dash.Dash(__name__) | ||
|
||
props = dict( | ||
id="table", | ||
columns=[dict(name="a", id="a", type="text", presentation="markdown")], | ||
data=[dict(a="<h1>html h1 heading</h1>")], | ||
) | ||
|
||
if markdown_options is not None: | ||
props["markdown_options"] = markdown_options | ||
|
||
app.layout = DataTable(**props) | ||
|
||
return app | ||
|
||
|
||
def test_tmdh001_html_not_allowed(test): | ||
test.start_server(get_app(None)) | ||
|
||
h1_elements = test.find_elements("h1") | ||
|
||
assert len(h1_elements) == 0 | ||
assert test.get_log_errors() == [] | ||
|
||
|
||
def test_tmdh002_html_allowed(test): | ||
test.start_server(get_app(dict(html=True))) | ||
|
||
h1_elements = test.find_elements("h1") | ||
|
||
assert len(h1_elements) == 1 | ||
assert test.get_log_errors() == [] |