Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to include this java code in my blog (this is with the enclosing pre's):

<pre class="prettyprint">
public Vector<Instruction> decodeTree(Tree<String> gene) {
    Vector<Instruction> ret = new Vector<Instruction>();
    Vector<Tree<String>> currentLayer = gene.getChildren();
    Vector<Tree<String>> nextLayer = new Vector<Tree<String>>();
    for(int i=0; i<currentLayer.size(); i++) {
        for(Tree<String> t: currentLayer.get(i).getChildren()) {

But because it has several angle brackets, Blogger goes in and autocompletes all the inferred tags, transforming that chunk into the following:

<pre class="prettyprint">public Vector<instruction> decodeTree(Tree<string> gene) {
    Vector<instruction> ret = new Vector<instruction>();
    Vector<tree tring="">&gt; currentLayer = gene.getChildren();
    Vector<tree tring="">&gt; nextLayer = new Vector<tree tring="">&gt;();
    for(int i=0; i<currentlayer .size="" for="" i="" ree="" tring=""> t: currentLayer.get(i).getChildren()) {

Which then shows up as:

public Vector decodeTree(Tree gene) {
    Vector ret = new Vector();
    Vector> currentLayer = gene.getChildren();
    Vector> nextLayer = new Vector>();
    for(int i=0; i t: currentLayer.get(i).getChildren()) {

Which is different from the code I'm trying to present. I think the problem originates in the html confusing my things with angle brackets with HTML tags. Is there a way I could get the parser to ignore all that? I tried changing all the angle brackets to &gt and &lt and got the following output:

public Vector&ltInstruction&gt decodeTree(Tree&ltString&gt gene) {
    Vector&ltInstruction&gt ret = new Vector&ltInstruction&gt();
    Vector&ltTree&ltString&gt&gt currentLayer = gene.getChildren();
    Vector&ltTree&ltString&gt&gt nextLayer = new Vector&ltTree&ltString&gt&gt();
    for(int i=0; i&ltcurrentLayer.size(); i++) {
        for(Tree&ltString&gt t: currentLayer.get(i).getChildren()) {
share|improve this question
Perhaps you can try your luck with this answer:webapps.stackexchange.com/a/37830/29140 – Jacob Jan Tuinstra May 22 '13 at 18:22
up vote 1 down vote accepted

You're putting this into a post? In the post-editor, in the bar at the right, there's a Options section near the bottom, which allows you to say "do not interpret HTML" code. Choosing this option makes Blogger present exactly what you entered.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.