File tree Expand file tree Collapse file tree 5 files changed +63
-4768
lines changed Expand file tree Collapse file tree 5 files changed +63
-4768
lines changed Original file line number Diff line number Diff line change @@ -34,18 +34,18 @@ const HLINT_SEV_TO_GITHUB_SEV = {
3434 Ignore : 'warning' ,
3535} ;
3636/**
37- * Use JSON escaping to turn messages with newlines and such into a single line .
37+ * Use JSON escaping to turn convert literal newlines to Github Action-supported newlines .
3838 */
3939function escapeString ( str , quote ) {
40- const jsonEscaped = JSON . stringify ( str ) . replace ( / \n / g, ' ' ) ;
40+ const jsonEscaped = JSON . stringify ( str ) . replace ( / \n / g, '%0A ' ) ;
4141 // Possibly drop the surrounding quotes
4242 return quote ? jsonEscaped : jsonEscaped . slice ( 1 , jsonEscaped . length - 1 ) ;
4343}
4444/**
4545 * Combine the non-"poblemMatcher" fields of an "idea" into
4646 * a single line as a human-readable message.
4747 *
48- * Fields are visually separated by a box character (' ▫︎ ') .
48+ * Fields are visually separated by newlines .
4949 */
5050function getNiceMessage ( idea ) {
5151 const prefixParts = [ ] ;
@@ -68,7 +68,7 @@ function getNiceMessage(idea) {
6868 if ( idea . note && idea . note . length ) {
6969 messageParts . push ( `Note: ${ idea . note . map ( n => escapeString ( n , false ) ) . join ( ' ' ) } ` ) ;
7070 }
71- const message = messageParts . join ( ' ▫︎ ' ) ;
71+ const message = messageParts . join ( '%0A ' ) ;
7272 return [ prefix , message ] . filter ( Boolean ) . join ( ': ' ) ;
7373}
7474function toMatchableProblem ( idea ) {
You can’t perform that action at this time.
0 commit comments