Spring-boot parses HTML5 tags without terminators

http://blog.csdn.net/ngl272/article/details/70215435
The landlord wrote very well. I did a little processing. The

problem
h5 now allows the label to not be closed.
When using springboot's thymeleaf template, the HTML will be strictly checked by default, so that when your tag is not closed, it will not pass, for example:

//To pass, the subsequent closure must be written as />
<meta charset="UTF- 8">


Solution:

1. Introduce nokohtml library
<!--Enable lax check html-->
<dependency>
    <groupId>net.sourceforge.nekohtml</groupId>
    <artifactId>nekohtml</artifactId>
    <version>1.9 .22</version>
</dependency>
2. Modify the configuration file application_dev.yml to join (if there is already thymeleaf, modify the mode)
thymeleaf:
   mode: LEGACYHTML5

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326226755&siteId=291194637