public String revisionsToWikitext(Revision[] revisions)
    {
        StringBuilder sb = new StringBuilder(revisions.length * 100);
        for (int i = 0; i < revisions.length; i++)
        {
            // base oldid link
            StringBuilder base2 = new StringBuilder(50);
            base2.append("<span class=\"plainlinks\">[");
            base2.append(base);
            base2.append(revisions[i].getPage().replace(" ", "_"));
            base2.append("&oldid=");
            base2.append(revisions[i].getRevid());

            // diff link
            sb.append("*(");
            sb.append(base2);
            sb.append("&diff=prev diff]</span>) ");

            // timestamp, link to oldid
            Calendar timestamp = revisions[i].getTimestamp();
            sb.append(base2);
            sb.append(" ");
            sb.append(timestamp.get(Calendar.YEAR));
            sb.append("-");
            int month = timestamp.get(Calendar.MONTH) + 1;
            if (month < 9)
                sb.append("0");
            sb.append(month);
            sb.append("-");
            int day = timestamp.get(Calendar.DAY_OF_MONTH);
            if (day < 10)
                sb.append("0");
            sb.append(day);
            sb.append(" ");
            int hour = timestamp.get(Calendar.HOUR);
            if (hour < 10)
                sb.append("0");
            sb.append(hour);
            sb.append(":");
            int minute = timestamp.get(Calendar.MINUTE);
            if (minute < 10)
                sb.append("0");
            sb.append(minute);
            sb.append("]</span> ");

            // user
            String user2 = revisions[i].getUser();
            sb.append("[[User:");
            sb.append(user2);
            sb.append("|");
            sb.append(user2);
            sb.append("]] ([[User talk:");
            sb.append(user2);
            sb.append("|talk]] | [[Special:Contributions/");
            sb.append(user2);
            sb.append("|contribs]]) (");

            // edit summary - nowiki any templates
            String summary = revisions[i].getSummary();
            if (summary.contains("}}"))
            {
                int a = summary.indexOf(("}}"));
                sb.append(summary.substring(0, a));
                sb.append("<nowiki>}}</nowiki>");
                sb.append(summary.substring(a + 2));
            }
            else
                sb.append(summary);
            sb.append(")\n");
        }
        return sb.toString();
    }