DArtagnant / blueJ-code-highlighter

format java code in html, imitating the style of the blue-J IDE
GNU General Public License v3.0
1 stars 0 forks source link

Indentation issue with for loops #17

Closed blastegit closed 3 months ago

blastegit commented 3 months ago

I have the impression that there's an overall problem with the indentation. In the following code, the indentation is not correct inside the for loop.

Here is the blueJ code hightlighter output code : image

And the real code indentation :

public String getItemString() {
    if (this.aMultipleItem.isEmpty()){
        return "Il n'y a point d'objets intéressants à l'horizon.";
    }

    StringBuilder itemsString = new StringBuilder("Objets disponibles : ");
    for (int i = 0; i < aMultipleItem.size(); i++) {
        Item item = aMultipleItem.get(i);
        itemsString.append(item.getName());
        if (i != aMultipleItem.size() - 1) {
            itemsString.append(", ");
        }
    }
    return itemsString.toString();
} //getItemString()
DArtagnant commented 3 months ago

Please add a meaningfull title next time to help me in my work.