Code highlighting now working again

There were some issues with our code highlighting. This should be fixed now. Report any weirdness.

3 Likes

Test:

[java]

public class MovementControl extends AbstractControl {

private final Vector3f velocity = new Vector3f();
private float speed=1;
private float timeToRun=-1;

public MovementControl() {
}

public void setSpeed(float speed) {
    this.speed = speed;
}

public float getSpeed() {
    return speed;
}

public void setVelocity(float x, float y, float z) {
    velocity.set(x, y, z);
    timeToRun = -1;
}

public Vector3f getVelocity() {
    return velocity;
}

public void setTimeToRun(float timeToRun) {
    this.timeToRun = timeToRun;
}

public float getTimeToRun() {
    return timeToRun;
}

@Override
protected void controlUpdate(float tpf) {
    tpf *= speed;

    if (timeToRun >= 0) {
        timeToRun -= tpf;
        if (timeToRun <= 0) {
            timeToRun = 0;
            return;
        }
    }

    this.spatial.move(velocity.x*tpf, velocity.y*tpf, velocity.z*tpf);
}

@Override
protected void controlRender(RenderManager rm, ViewPort vp) {
}

}
[/java]

Test 2.

@zarch said: Test:

[java]

public class MovementControl extends AbstractControl {

private final Vector3f velocity = new Vector3f();
private float speed=1;
private float timeToRun=-1;

public MovementControl() {
}

public void setSpeed(float speed) {
    this.speed = speed;
}

public float getSpeed() {
    return speed;
}

public void setVelocity(float x, float y, float z) {
    velocity.set(x, y, z);
    timeToRun = -1;
}

public Vector3f getVelocity() {
    return velocity;
}

public void setTimeToRun(float timeToRun) {
    this.timeToRun = timeToRun;
}

public float getTimeToRun() {
    return timeToRun;
}

@Override
protected void controlUpdate(float tpf) {
    tpf *= speed;

    if (timeToRun >= 0) {
        timeToRun -= tpf;
        if (timeToRun <= 0) {
            timeToRun = 0;
            return;
        }
    }

    this.spatial.move(velocity.x*tpf, velocity.y*tpf, velocity.z*tpf);
}

@Override
protected void controlRender(RenderManager rm, ViewPort vp) {
}

}
[/java]

Nice. Infinitely better :smiley:

Just one minor quibble - if you edit a post then in the edited text you correctly see >= (for example). If you quote reply though then you see & g t ; etc in place of the characters inside your text (although when you submit the message that gets taken and processed correctly and the result looks right - which is why its a minor quibble.

You still cant put xml in though, even inside java tags. (I know its XML not java but still…)

Wee! :slight_smile:



    
        XSLT Cookbook
        Sal Mangano
    
    
        Skriv med XML
        Åsa Blom
   

[java]
class Test{
public Test(){
String string = “will this string be quoted in a copy paste friendly format?”;
}
}
[/java]

Nope XML still do not work, not even inside [code] tags… <— it also changes the word code in square brackets to java in square brackets…
And still that stupid highlighter does not use regular double quotes for strings which is annoying as hell.

Is the highlighting done server side or added by a javascript?

Thank you, this was driving me crazy.