Closed Suna-Wang closed 2 years ago
@Suna-Wang j2html provides automatic text escaping in most cases. For your example you can use:
pre( code("#include <iostream>void main(){cout << "Hello!" << end1;}") ).render()
which will produce this html:
<pre><code>#include <iostream>void main(){cout << "Hello!" << end1;}</code></pre>
which the browser should render into the output you desired.
Thank you very much!~
I wrote a test case to test the code tag, the case is followed:
} What I expected is
But the output is
Then the output will be different from the real need. expected:
includevoid main(){cout << "Hello!" << end1;}
output:
include <iostream>void main(){cout << "Hello!" << end1;}
How can I produce what I want?