@@ -98,20 +98,20 @@ async function createReport(results) {
98
98
99
99
report += `- **${ grouped . total } ** audits in total\n` ;
100
100
if ( grouped . ok . length ) {
101
- report += `- **${ grouped . ok . length } ** pass\n` ;
101
+ report += `- ✅ **${ grouped . ok . length } ** pass\n` ;
102
102
}
103
103
if ( grouped . warn . length ) {
104
- report += `- **${ grouped . warn . length } ** warnings (optional)\n` ;
104
+ report += `- ${ '⚠️' } **${ grouped . warn . length } ** warnings (optional)\n` ;
105
105
}
106
106
if ( grouped . error . length ) {
107
- report += `- **${ grouped . error . length } ** errors (required)\n` ;
107
+ report += `- ❌ **${ grouped . error . length } ** errors (required)\n` ;
108
108
}
109
109
report += `\n` ;
110
110
111
111
if ( grouped . ok . length ) {
112
112
report += `## Passing\n` ;
113
113
for ( const [ i , result ] of grouped . ok . entries ( ) ) {
114
- report += `${ i + 1 } . ✅ ${ result . name } \n` ;
114
+ report += `${ i + 1 } . ${ escapeMarkdown ( result . name ) } \n` ;
115
115
}
116
116
report += '\n' ;
117
117
}
@@ -120,8 +120,10 @@ async function createReport(results) {
120
120
report += `## Warnings\n` ;
121
121
report += `The server _SHOULD_ support these, but is not required.\n` ;
122
122
for ( const [ i , result ] of grouped . warn . entries ( ) ) {
123
- report += `${ i + 1 } . ${ '⚠️' } ${ result . name } <br />\n` ;
124
- report += ` 💬 ${ result . reason } \n` ;
123
+ report += `${ i + 1 } . ${ escapeMarkdown ( result . name ) } <br />\n` ;
124
+ report += '```\n' ;
125
+ report += `${ result . reason } \n` ;
126
+ report += '```\n' ;
125
127
}
126
128
report += '\n' ;
127
129
}
@@ -130,8 +132,10 @@ async function createReport(results) {
130
132
report += `## Errors\n` ;
131
133
report += `The server _MUST_ support these.\n` ;
132
134
for ( const [ i , result ] of grouped . error . entries ( ) ) {
133
- report += `${ i + 1 } . ❌ ${ result . name } <br />\n` ;
134
- report += ` 💬 ${ result . reason } \n` ;
135
+ report += `${ i + 1 } . ${ escapeMarkdown ( result . name ) } <br />\n` ;
136
+ report += '```\n' ;
137
+ report += `${ result . reason } \n` ;
138
+ report += '```\n' ;
135
139
}
136
140
}
137
141
@@ -146,3 +150,10 @@ async function createReport(results) {
146
150
} ,
147
151
} ;
148
152
}
153
+
154
+ /**
155
+ * @param {string } str
156
+ */
157
+ function escapeMarkdown ( str ) {
158
+ return str . replace ( / \* / g, '\\*' ) ;
159
+ }
0 commit comments