Skip to content

Conversation

@tonycpsu
Copy link
Contributor

I was dumping output from cdiff into a notebook and noticed that its use of underline and inverse escape codes wasn't being reflected in the notebook output. A couple simple tweaks to the ANSI parsing and some added CSS classes and it now does.

* Parse underline and inverse in ANSI escape codes
* Add CSS classes for same, using a subtle outline for inverse
Copy link
Member

@takluyver takluyver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I briefly tested this and it appears to be working.

"source": [
"print (\"This is normal text\")\n",
"print()\n",
"print (\"{ESC}01mThis is bold text\".format(**locals()))\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intentional that you don't reset the style between lines, so this actually generates:

  • normal
  • bold
  • bold + underlined
  • bold + underlined + inverse

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, good catch. I've updated the test to reset.

@takluyver takluyver added this to the 5.0 milestone Feb 14, 2017
@takluyver
Copy link
Member

Great, thanks. This looks good to me.

@takluyver takluyver merged commit a33d136 into jupyter:master Feb 14, 2017
mgeier added a commit to mgeier/notebook that referenced this pull request Oct 23, 2017
The "inverse" escape sequence was implemented in jupyter#2186, but not by
actually inverting foreground and background.
mgeier added a commit to mgeier/notebook that referenced this pull request Oct 23, 2017
The "inverse" escape sequence was implemented in jupyter#2186, but not by
actually inverting foreground and background.
@mgeier mgeier mentioned this pull request Oct 23, 2017
mgeier added a commit to mgeier/notebook that referenced this pull request Nov 1, 2017
The "inverse" escape sequence was implemented in jupyter#2186, but not by
actually inverting foreground and background.
gnestor pushed a commit that referenced this pull request Nov 1, 2017
* Invert inverse ANSI colors

The "inverse" escape sequence was implemented in #2186, but not by
actually inverting foreground and background.

* ANSI colors: allow switching off underline and inverse

* Add CSS classes ansi-default-inverse-fg and ...-bg
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants