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 = (
50
50
? await import ( 'html-validate/dist/formatters/codeframe' ) . then ( r => r . default || /* istanbul ignore next */ r )
51
51
: await import ( 'html-validate/dist/formatters/stylish' ) . then ( r => r . default || /* istanbul ignore next */ r )
52
52
53
- const formattedResult = formatter ( results )
53
+ const rules = Array . from ( new Set ( results [ 0 ] ?. messages . map ( ( { ruleId } ) => ruleId ) ) )
54
54
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
+ } )
59
59
60
60
reporter . error (
61
61
[
62
62
`HTML validation errors found for ${ chalk . bold ( url ) } ` ,
63
- formattedResult ,
64
- urls . length ? `${ chalk . bold ( 'More information:' ) } ` : '' ,
65
- ...urls
63
+ formattedResult
66
64
] . join ( '\n' )
67
65
)
68
66
}
You can’t perform that action at this time.
0 commit comments