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

Merge neighboring identical tags in Owl.Data.from_ansidata/1 & increase coverage #15

Merged
merged 1 commit into from
Mar 24, 2023

Conversation

zachallaun
Copy link
Contributor

This PR does two things:

  1. When converting ansidata to Owl data, merge neighboring identical tags when recursively constructing the data. This is especially helpful when dealing with charlists:
# before
iex> Owl.Data.from_ansidata(IO.ANSI.format([:red, 'Hello']))
[[[[Owl.Data.tag(72, :red), Owl.Data.tag(101, :red)], Owl.Data.tag(108, :red)], Owl.Data.tag(108, :red)], Owl.Data.tag(111, :red)]

# after
iex> Owl.Data.from_ansidata(IO.ANSI.format([:red, 'Hello']))
Owl.Data.tag([[['He', 108], 108], 111], :red)
  1. Adds missing test coverage referenced here.

@fuelen fuelen merged commit d6b583b into fuelen:main Mar 24, 2023
@fuelen
Copy link
Owner

fuelen commented Mar 24, 2023

Thanks!

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.

2 participants