Fix py-markdown plugin (#1008)

* fix wrong console method and unescape the tag content before running markdown on it

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add markdown plugin example test

* add PyMarkdown minimal test

* remove commented code

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove import of console from pyscript

* remove unused imports

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Fabio Pliger <fpliger@anaconda.com>
This commit is contained in:
Fabio Pliger
2022-12-08 10:09:31 -08:00
committed by GitHub
parent 1c7cf0ba7d
commit 9a5bf9918e
5 changed files with 42 additions and 6 deletions

View File

@@ -176,6 +176,17 @@ class TestExamples(PyScriptTest):
zoom_out.click()
self.assert_no_banners()
def test_markdown_plugin(self):
# Given the example page with:
# * <title>PyMarkdown</title>
# * <py-md>#Hello world!</py-md>
self.goto("examples/markdown-plugin.html")
self.wait_for_pyscript()
# ASSERT title is rendered correctly
assert self.page.title() == "PyMarkdown"
# ASSERT markdown is rendered to the corresponding HTML tag
wait_for_render(self.page, "*", "<h1>Hello world!</h1>")
def test_matplotlib(self):
self.goto("examples/matplotlib.html")
self.wait_for_pyscript()