In my application, I need to prevent HTML from rendering
"if (a<b || c>100) ..."
and
"cout << ...".
Also the entire C++ code region HTML must pass through the GCC compiler with the desired effect. I've hit on two schemes:
First:
//<xmp>
#include <string>
//</xmp>}
For reasons that escape me, the <xmp>
tag is deprecated. I find (2016-01-09) that Chrome and FF, at least, render the tag the way I want. While researching my problem, I saw a remark that <xmp> is required in HTML 5.
Second, in <head> ... </head>
, insert:
<style type="text/css">
textarea { border: none; }
</style>
Then in <body> ... </body>
, write:
//<br /> <textarea rows="4" disabled cols="80">
#include <stdlib.h>
#include <iostream>
#include <string>
//</textarea> <br />
Note: Set "cols="80"
to prevent following text from appearing on the right. Set "rows=..."
to one more line than you enclose in the tag. This prevents scroll bars. This second technique has several disadvantages:
- The "disabled" attribute shades the region
- Incomprehensible, complex comments in the code sent to the compiler
- Harder to understand
- More typing
However, this methhod is neither obsolete nor deprecated. The gods of HTML will make their faces to shine unto you.