Details
Description
The new module sonar-colorizer supports Java and Groovy by default. Plugins can add support of new languages by implementing the class org.sonar.api.web.CodeColorizerFormat. Example :
public class PhpColorizerFormat extends org.sonar.api.web.CodeColorizerFormat { public PhpColorizerFormat() { super(Php.KEY); } @Override public List<Tokenizer> getTokenizersForHtml() { return Arrays.asList( new StringTokenizer("<span class=\"s\">", "</span>"), new KeywordsTokenizer("<span class=\"k\">", "</span>", PhpKeywords.get()) ); } }
See the module sonar-colorizer for more details.