Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spacy/displacy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def render(
if jupyter or (jupyter is None and is_in_jupyter()):
# return HTML rendered by IPython display()
# See #4840 for details on span wrapper to disable mathjax
from IPython.core.display import HTML, display
from IPython.display import HTML, display

return display(HTML('<span class="tex2jax_ignore">{}</span>'.format(html)))
return html
Expand Down
2 changes: 1 addition & 1 deletion website/docs/api/top-level.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1452,7 +1452,7 @@ detecting the IPython kernel. Mainly used for the
> ```python
> html = "<h1>Hello world!</h1>"
> if util.is_in_jupyter():
> from IPython.core.display import display, HTML
> from IPython.display import display, HTML
> display(HTML(html))
> ```

Expand Down
4 changes: 2 additions & 2 deletions website/docs/usage/visualizers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,12 @@ rendering if auto-detection fails.

![displaCy visualizer in a Jupyter notebook](/images/displacy_jupyter.jpg)

Internally, displaCy imports `display` and `HTML` from `IPython.core.display`
Internally, displaCy imports `display` and `HTML` from `IPython.display`
and returns a Jupyter HTML object. If you were doing it manually, it'd look like
this:

```python
from IPython.core.display import display, HTML
from IPython.display import display, HTML

html = displacy.render(doc, style="dep")
display(HTML(html))
Expand Down