File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -50,19 +50,17 @@ export const useChecker = (
5050 ? await import ( 'html-validate/dist/formatters/codeframe' ) . then ( r => r . default || /* istanbul ignore next */ r )
5151 : await import ( 'html-validate/dist/formatters/stylish' ) . then ( r => r . default || /* istanbul ignore next */ r )
5252
53- const formattedResult = formatter ( results )
53+ const rules = Array . from ( new Set ( results [ 0 ] ?. messages . map ( ( { ruleId } ) => ruleId ) ) )
5454
55- const urls =
56- results [ 0 ] ?. messages . map (
57- ( { ruleId } : any ) => `https://html-validate.org/rules/${ ruleId } .html`
58- ) || [ ]
55+ let formattedResult = formatter ( results )
56+ rules . forEach ( ( ruleId ) => {
57+ formattedResult = formattedResult . replace ( new RegExp ( ruleId , 'g' ) , `https://html-validate.org/rules/${ ruleId } .html` )
58+ } )
5959
6060 reporter . error (
6161 [
6262 `HTML validation errors found for ${ chalk . bold ( url ) } ` ,
63- formattedResult ,
64- urls . length ? `${ chalk . bold ( 'More information:' ) } ` : '' ,
65- ...urls
63+ formattedResult
6664 ] . join ( '\n' )
6765 )
6866}
You can’t perform that action at this time.
0 commit comments