Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

39 and 49 are not global resets #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion lib/ansi/to/html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def each
yield data
when :display
case code = data
when 0,39,49 ; yield reset_styles if @stack.any? # NOTE: 39/49 is reset for fg/bg color only
when 0 ; yield reset_styles if @stack.any?
when 1 ; yield push_tag("b") # bright
when 2 ; #dim
when 3, 4 ; yield push_tag("u")
Expand All @@ -101,7 +101,9 @@ def each
when 8 ; yield push_style("display:none")
when 9 ; yield push_tag("strike")
when 30..37 ; yield push_style("ef#{code - 30}")
when 39 ; yield push_style("ef7") # reset fg
when 40..47 ; yield push_style("eb#{code - 40}")
when 49 ; yield push_style("eb0") # reset bg
when 90..97 ; yield push_style("ef#{8 + code - 90}")
when 100..107 ; yield push_style("eb#{8 + code - 100}")
end
Expand Down