I'm using HTML Tidy written by PHP, but one of the JavaScript stringsThe HTML Tidy output code is as follows: "'"' Above willInterpreted as part of the script. Then it adds aDisables the opening of labels. I tried to use the HTML Tidy to fix the problem, but the results still show that the error is running. How do I solve this problem?
Original problem: HTML Tidy fails on script tag in JavaScript string literal
Reply content:
I'm using PHP's HTML Tidy, but one of the "HTML Tidy output codes on the JavaScript string is as follows:" "The interpreter is part of the script. Then it adds a ban to open the label. I tried to use the HTML Tidy to fix the problem, but the results still show that the error is running. How do I solve this problem?
Original problem: HTML Tidy fails on script tag in JavaScript string literal
Answer: Arch
Based on experience, I think you can use//' <\/script> ' to control an algorithm to prevent this error from happening:
The clean-up algorithm is as follows:
I think it might be because the clean-up algorithm detects two strings. The separation < with/script> makes the second one undetectable so that it adds another at the end of the code.
So, I ventured to guess that there is no if statement in the entire algorithm to determine if there is any in the comment. So, if necessary, you can add another <\/script> string to the JavaScript comment, allowing the entire algorithm to identify two of them.
Answer: Herrserker
Instead of writing the script tag in a sentence, use the collocated string to express it:
Result Cleanup code:
Answer: Chris G
I think it's better to create a script tag using the following method: