-
Notifications
You must be signed in to change notification settings - Fork 66
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
fix(text) escape value before rendering styles #20
fix(text) escape value before rendering styles #20
Conversation
Codecov Report
@@ Coverage Diff @@
## main #20 +/- ##
==========================================
+ Coverage 49.85% 54.09% +4.23%
==========================================
Files 23 23
Lines 700 721 +21
==========================================
+ Hits 349 390 +41
+ Misses 335 317 -18
+ Partials 16 14 -2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Thank you @tombell! Adding a test for this would be nice :) |
@aymanbagabas just figuring out how the existing test broke first :) |
@aymanbagabas trying to figure out the best approach to adding some test cases. Since |
@tombell you could modify the func TestStyles(t *testing.T) {
var buf bytes.Buffer
l := New(WithOutput(&buf)).(*logger)
l.noStyles = false
...
} |
@aymanbagabas believe I've got this sorted now, all pushed up. |
I believe I've refactored enough to simplify the solution. |
* fix(text) escape value before rendering style * fix(text) render value style before escaping * test(text) add additional test cases
Update to essentially render lipgloss styles for values after escaping and indenting.
l *looger
receiver towriteEscapedForOutput
for access tol.noStyles
l *logger
receiver towriteIdent
to be able to call the updatedwriteEscapedForOutput
writeEscapedForOutput
to callValueStyle.Render
after escaping the values, or if the values don't need need escapingFix #19