IDEA编辑thymeleaf模板如何去除下划红线

前端之家收集整理的这篇文章主要介绍了IDEA编辑thymeleaf模板如何去除下划红线前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

问题描述

不多说,直接上图。本身代码没啥问题,就是强迫症看着难受,如何去除呢?

解决方

一、修改IDEA针对thymeleaf表达式的报错提醒级别

File->Settings->Editor->Inspections,搜索thymeleaf,右键Expression variables validation的级别,不是Error就行。

二、添加suppress ALL

<!DOCTYPE html>
<!--suppress ALL-->
<html xmlns:th="http://www.thymeleaf.org">
    <head>
        <Meta charset="UTF-8">
        <title>Hello</title>
    </head>
    <body>
        点击链接: <a href="http://www.hyhwky.com" th:href="${info}"></a>
    </body>
</html>

参考资料

猜你在找的IDEA相关文章