-
-
Notifications
You must be signed in to change notification settings - Fork 86
Allow escape sequences to span multiple lines and support default fg/bg colors #137
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e6b8ff5
Reproduce #135 in a test
dwnusbaum cfa7144
Fix #137 by closing open tags at the end of lines and reopening them
dwnusbaum a95ea81
Close whole AnsiHtmlOutputStream instead of inidividual tags and mino…
dwnusbaum 2c19b61
Support color maps that set default foreground/background colors
dwnusbaum a2a74eb
Track character offsets correctly for multi-byte characters
dwnusbaum 7d8b58d
Merge branch 'master' into multiline-sequence-bug
dwnusbaum c1d7aab
Handle multi-byte characters correctly instead of truncating them
dwnusbaum 50893ab
Add Japanese text to non-ascii test case
dwnusbaum ce424f3
Remove unused code
dwnusbaum be7df32
Merge branch 'master' into multiline-sequence-bug
dwnusbaum 31bb937
Remove unnecessary implementation of readResolve
dwnusbaum 200bf2b
Address review feedback and add changelog entry
dwnusbaum File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,7 @@ | |
| import static org.junit.Assert.*; | ||
| import org.junit.Assume; | ||
| import org.junit.ClassRule; | ||
| import org.junit.Ignore; | ||
| import org.junit.Rule; | ||
| import org.junit.runners.model.Statement; | ||
| import org.jvnet.hudson.test.BuildWatcher; | ||
|
|
@@ -88,6 +89,34 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen | |
| }); | ||
| } | ||
|
|
||
| @Test | ||
| @Ignore | ||
|
||
| public void testMultilineEscapeSequence() throws Exception { | ||
| story.then(r -> { | ||
| FreeStyleProject p = r.createFreeStyleProject(); | ||
| p.getBuildWrappersList().add(new AnsiColorBuildWrapper(null)); | ||
| p.getBuildersList().add(new TestBuilder() { | ||
| @Override | ||
| public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { | ||
| listener.getLogger().println("\u001B[1;34mThis text should be bold and blue"); | ||
| listener.getLogger().println("\u001B[mThis text should be normal"); | ||
| return true; | ||
| } | ||
| }); | ||
| FreeStyleBuild b = r.buildAndAssertSuccess(p); | ||
| StringWriter writer = new StringWriter(); | ||
| b.getLogText().writeHtmlTo(0L, writer); | ||
| String html = writer.toString(); | ||
| System.out.print(html); | ||
| assertThat(html.replaceAll("<span style=\"display: none\">.+?</span>", ""), | ||
| allOf( | ||
| // <b> and <span> are never closed. | ||
| containsString("<b><span style=\"color: #1E90FF;\">This text should be bold and blue</span></b>"), | ||
| // This should be inside of a span with `display: none`, but it is not. | ||
| not(containsString("\u001B[m")))); | ||
| }); | ||
| } | ||
|
|
||
| @Issue("JENKINS-54133") | ||
| @Test | ||
| public void testWorkflowWrap() throws Exception { | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should create a JIRA issue for these and add
@Issue.