Skip to content

Fix Markdown and JSON __repr__ to return actual data#15230

Open
asgharale wants to merge 2 commits into
ipython:mainfrom
asgharale:fix-Markdown-rendering-in-output
Open

Fix Markdown and JSON __repr__ to return actual data#15230
asgharale wants to merge 2 commits into
ipython:mainfrom
asgharale:fix-Markdown-rendering-in-output

Conversation

@asgharale
Copy link
Copy Markdown

Problem

Markdown and JSON display objects had no __repr__, so they fell
back to DisplayObject.__repr__ which returns the unhelpful
<IPython.core.display.Markdown object> string. This caused nbconvert
output and terminal reprs to show garbage instead of actual content.

Changes

Notes

  • Builds on the approach in Add a 'text/plain' repr to Markdown and JSON #14150 and directly addresses the
    maintainer feedback requesting json.dumps with indentation
  • test_display_formatter_active_types_config failure is a
    pre-existing Windows environment issue unrelated to this PR

Closes #12895

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Markdown rendering in output

1 participant