File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -399,6 +399,14 @@ void HtmlWriter::Private::writeNewDefWarning(const Defect &def) {
399
399
<< this ->newDefMsg << " ]</span>" ;
400
400
}
401
401
402
+ void linkifyShellCheckMsg (std::string *pMgs) {
403
+ static boost::regex reShellCheckMsg (" \\ [SC([0-9]+)\\ ]$" );
404
+ *pMgs = boost::regex_replace (*pMgs, reShellCheckMsg,
405
+ " <a href=\" https://github.com/koalaman/shellcheck/wiki/SC\\ 1\" "
406
+ " title=\" description of ShellCheck's checker SC\\ 1\" >"
407
+ " [SC\\ 1]</a>" );
408
+ }
409
+
402
410
void HtmlWriter::handleDef (const Defect &def) {
403
411
d->core .writeHeaderOnce (d->scanProps , d->plainTextUrl );
404
412
@@ -479,7 +487,11 @@ void HtmlWriter::handleDef(const Defect &def) {
479
487
d->str << " <span style='color: #" << color << " ;'>" ;
480
488
}
481
489
482
- d->str << HtmlLib::escapeTextInline (evt.msg );
490
+ // translate message text
491
+ std::string msgText = HtmlLib::escapeTextInline (evt.msg );
492
+ if (def.checker == " SHELLCHECK_WARNING" )
493
+ linkifyShellCheckMsg (&msgText);
494
+ d->str << msgText;
483
495
484
496
if (isCtxLine)
485
497
d->str << " </span>" ;
You can’t perform that action at this time.
0 commit comments