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
6 changes: 6 additions & 0 deletions IPython/core/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,9 @@ def __html__(self):

class Markdown(TextDisplayObject):

def __repr__(self):
return self.data

def _repr_markdown_(self):
return self._data_and_metadata()

Expand Down Expand Up @@ -640,6 +643,9 @@ def data(self, data):
def _data_and_metadata(self):
return self.data, self.metadata

def __repr__(self):
return json.dumps(self.data, indent=2)

def _repr_json_(self):
return self._data_and_metadata()

Expand Down
3 changes: 2 additions & 1 deletion tests/test_display_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ def test_geojson():
"maxZoom": 18,
},
)
assert "<IPython.core.display.GeoJSON object>" == str(gj)
# assert "<IPython.core.display.GeoJSON object>" == str(gj)
assert str(gj) == json.dumps(gj.data, indent=2)


def test_retina_png():
Expand Down
Loading