From afa708d55237f3919523fe010c122b35492d2c6e Mon Sep 17 00:00:00 2001 From: low012 Date: Sun, 26 Sep 2010 12:57:07 +0000 Subject: [PATCH] *) added ... tag to WikiCode -> works just as the HTML equivalent *) code changes (PMD) without functional changes git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7193 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/data/wiki/wikiBoard.java | 93 ++++++------- source/de/anomic/data/wiki/wikiCode.java | 151 ++++++++++++---------- 2 files changed, 129 insertions(+), 115 deletions(-) diff --git a/source/de/anomic/data/wiki/wikiBoard.java b/source/de/anomic/data/wiki/wikiBoard.java index a14e302c6..e95575698 100644 --- a/source/de/anomic/data/wiki/wikiBoard.java +++ b/source/de/anomic/data/wiki/wikiBoard.java @@ -45,9 +45,10 @@ import net.yacy.kelondro.order.NaturalOrder; public class wikiBoard { public static final int keyLength = 64; - private static final String dateFormat = "yyyyMMddHHmmss"; + private static final String DATE_FORMAT = "yyyyMMddHHmmss"; + private static final String ANONYMOUS = "anonymous"; - protected static final SimpleDateFormat SimpleFormatter = new SimpleDateFormat(dateFormat, Locale.US); + protected static final SimpleDateFormat SimpleFormatter = new SimpleDateFormat(DATE_FORMAT, Locale.US); static { SimpleFormatter.setTimeZone(TimeZone.getTimeZone("GMT")); @@ -66,7 +67,7 @@ public class wikiBoard { new File(bkppath.getParent()).mkdirs(); if (bkpbase == null) { //bkpbase = new MapView(BLOBTree.toHeap(bkppath, true, true, keyLength + dateFormat.length(), recordSize, '_', NaturalOrder.naturalOrder, bkppathNew), 500, '_'); - bkpbase = new MapHeap(bkppath, keyLength + dateFormat.length(), NaturalOrder.naturalOrder, 1024 * 64, 500, '_'); + bkpbase = new MapHeap(bkppath, keyLength + DATE_FORMAT.length(), NaturalOrder.naturalOrder, 1024 * 64, 500, '_'); } } @@ -94,17 +95,11 @@ public class wikiBoard { } private static String normalize(final String key) { - if (key == null) return "null"; - return key.trim().toLowerCase(); + return (key != null) ? key.trim().toLowerCase() : "null"; } - public static String webalize(String key) { - if (key == null) return "null"; - key = key.trim().toLowerCase(); - int p; - while ((p = key.indexOf(" ")) >= 0) - key = key.substring(0, p) + "%20" + key.substring(p +1); - return key; + public static String webalize(final String key) { + return (key != null) ? normalize(key).replaceAll(" ", "%20") : "null"; } public static String guessAuthor(final String ip) { @@ -122,6 +117,7 @@ public class wikiBoard { } public class entry { + private static final String ANONYMOUS = "anonymous"; String key; Map record; @@ -129,18 +125,27 @@ public class wikiBoard { public entry(final String subject, String author, String ip, String reason, final byte[] page) throws IOException { record = new HashMap(); key = subject; - if (key.length() > keyLength) key = key.substring(0, keyLength); + if (key.length() > keyLength) { + key = key.substring(0, keyLength); + } record.put("date", dateString()); - if ((author == null) || (author.length() == 0)) author = "anonymous"; + if ((author == null) || (author.length() == 0)) { + author = ANONYMOUS; + } record.put("author", Base64Order.enhancedCoder.encode(author.getBytes("UTF-8"))); - if ((ip == null) || (ip.length() == 0)) ip = ""; + if ((ip == null) || (ip.length() == 0)) { + ip = ""; + } record.put("ip", ip); - if ((reason == null) || (reason.length() == 0)) reason = ""; + if ((reason == null) || (reason.length() == 0)) { + reason = ""; + } record.put("reason", Base64Order.enhancedCoder.encode(reason.getBytes("UTF-8"))); - if (page == null) + if (page == null) { record.put("page", ""); - else + } else { record.put("page", Base64Order.enhancedCoder.encode(page)); + } authors.put(ip, author); //System.out.println("DEBUG: setting author " + author + " for ip = " + ip + ", authors = " + authors.toString()); } @@ -171,26 +176,26 @@ public class wikiBoard { public String author() { final String a = record.get("author"); - if (a == null) return "anonymous"; - final byte[] b = Base64Order.enhancedCoder.decode(a); - if (b == null) return "anonymous"; - return new String(b); + final byte[] b; + return (a != null && (b = Base64Order.enhancedCoder.decode(a)) != null) ? new String(b) : ANONYMOUS; } public String reason() { final String r = record.get("reason"); - if (r == null) return ""; + if (r == null) { + return ""; + } final byte[] b = Base64Order.enhancedCoder.decode(r); - if (b == null) return "unknown"; + if (b == null) { + return "unknown"; + } return new String(b); } public byte[] page() { final String m = record.get("page"); - if (m == null) return new byte[0]; - final byte[] b = Base64Order.enhancedCoder.decode(m); - if (b == null) return "".getBytes(); - return b; + final byte[] b; + return (m != null && (b = Base64Order.enhancedCoder.decode(m)) != null) ? b : new byte[0]; } void setAncestorDate(final Date date) { @@ -223,8 +228,7 @@ public class wikiBoard { public entry getAncestor() { final Date ancDate = getAncestorDate(); - if (ancDate == null) return null; - return read(key + dateString(ancDate), bkpbase); + return (ancDate == null) ? null : read(key + dateString(ancDate), bkpbase); } void setChild(final String subject) { @@ -233,28 +237,24 @@ public class wikiBoard { private String getChildName() { final String c = record.get("child"); - if (c == null) return null; - final byte[] subject = Base64Order.enhancedCoder.decode(c); - if (subject == null) return null; - return new String(subject); + final byte[] subject; + return (c != null && (subject = Base64Order.enhancedCoder.decode(c)) != null) ? new String(subject) : null; } public boolean hasChild() { final String c = record.get("child"); - if (c == null) return false; - final byte[] subject = Base64Order.enhancedCoder.decode(c); - return (subject != null); + return (c != null && Base64Order.enhancedCoder.decode(c) != null) ? true : false; } public entry getChild() { final String childName = getChildName(); - if (childName == null) return null; - return read(childName, datbase); + return (childName == null) ? null : read(childName, datbase); } } public String write(final entry page) { // writes a new page and returns key + String ret = null; try { // first load the old page final entry oldEntry = read(page.key); @@ -269,11 +269,11 @@ public class wikiBoard { bkpbase.insert((page.key + dateString(oldDate)).getBytes(), oldEntry.record); // write the new page datbase.insert(page.key.getBytes(), page.record); - return page.key; + ret = page.key; } catch (final Exception e) { Log.logException(e); - return null; } + return ret; } public entry read(final String key) { @@ -281,19 +281,20 @@ public class wikiBoard { } entry read(String key, final MapHeap base) { + entry ret = null; try { key = normalize(key); - if (key.length() > keyLength) key = key.substring(0, keyLength); + if (key.length() > keyLength) { + key = key.substring(0, keyLength); + } final Map record = base.get(key.getBytes()); - if (record == null) return newEntry(key, "anonymous", "127.0.0.1", "New Page", "".getBytes()); - return new entry(key, record); + ret = (record == null) ? newEntry(key, ANONYMOUS, "127.0.0.1", "New Page", "".getBytes()) : new entry(key, record); } catch (final IOException e) { Log.logException(e); - return null; } catch (RowSpaceExceededException e) { Log.logException(e); - return null; } + return ret; } public entry readBkp(final String key) { diff --git a/source/de/anomic/data/wiki/wikiCode.java b/source/de/anomic/data/wiki/wikiCode.java index 62dfe8dd9..a71c4f2ef 100644 --- a/source/de/anomic/data/wiki/wikiCode.java +++ b/source/de/anomic/data/wiki/wikiCode.java @@ -41,44 +41,49 @@ import de.anomic.server.serverCore; * @author Alexander Schier [AS], Franz Brausze [FB], Marc Nause [MN] */ public class wikiCode extends abstractWikiParser implements wikiParser { - public static final String WIKI_EMPHASIZE_1 = "\'\'"; - public static final String WIKI_EMPHASIZE_2 = "\'\'\'"; private static final String ASTERISK = "*"; - private static final String CLOSE_DEFINITION_DESCRIPTION = ""; - private static final String CLOSE_DEFINITION_ITEM = ""; - private static final String CLOSE_DEFINITION_LIST = ""; - private static final char ONE = '1'; - private static final char THREE = '3'; - private static final char TWO = '2'; + private static final String EMPTY = ""; + private static final String PIPE_ESCAPED = "|"; + private static final String REGEX_NOT_CHAR_NUM_OR_UNDERSCORE = "[^a-zA-Z0-9_]"; + + private static final String HTML_OPEN_DEFINITION_DESCRIPTION = "
"; + private static final String HTML_CLOSE_DEFINITION_DESCRIPTION = "
"; + private static final String HTML_OPEN_DEFINITION_ITEM = "
"; + private static final String HTML_CLOSE_DEFINITION_ITEM = "
"; + private static final String HTML_OPEN_DEFINITION_LIST = "
"; + private static final String HTML_CLOSE_DEFINITION_LIST = "
"; + private static final String HTML_OPEN_UNORDERED_LIST = "
    "; + private static final String HTML_CLOSE_UNORDERED_LIST = "
"; + private static final String HTML_CLOSE_BLOCKQUOTE = ""; + private static final String HTML_CLOSE_LIST_ELEMENT = ""; + private static final String HTML_CLOSE_ORDERED_LIST = ""; + private static final String HTML_OPEN_BLOCKQUOTE = "
"; + private static final String HTML_OPEN_LIST_ELEMENT = "
  • "; + private static final String HTML_OPEN_ORDERED_LIST = "
      "; + + private static final String WIKI_CLOSE_LINK = "]]"; + private static final String WIKI_OPEN_LINK = "[["; private static final String WIKI_CLOSE_EXTERNAL_LINK = "]"; private static final String WIKI_CLOSE_PRE_ESCAPED = "</pre>"; - private static final String CLOSE_UNORDERED_LIST = ""; + private static final String WIKI_OPEN_STRIKE = "<s>"; + private static final String WIKI_CLOSE_STRIKE = "</s>"; + private static final String WIKI_EMPHASIZE_1 = "\'\'"; + private static final String WIKI_EMPHASIZE_2 = "\'\'\'"; private static final String WIKI_EMPHASIZE_3 = "\'\'\'\'\'"; - private static final char WIKI_FORMATTED = ' '; private static final String WIKI_HEADLINE_TAG_1 = "=="; private static final String WIKI_HEADLINE_TAG_2 = "==="; private static final String WIKI_HEADLINE_TAG_3 = "===="; - private static final String OPEN_DEFINITION_DESCRIPTION = "
      "; - private static final String OPEN_DEFINITION_ITEM = "
      "; private static final String WIKI_HR_LINE = "----"; private static final String WIKI_IMAGE = "Image:"; - private static final char WIKI_INDENTION = ':'; private static final String WIKI_OPEN_EXTERNAL_LINK = "["; private static final String WIKI_OPEN_PRE_ESCAPED = "<pre>"; - private static final String OPEN_UNORDERED_LIST = "
        "; - private static final String EMPTY = ""; - private static final String CLOSE_BLOCKQUOTE = "
  • "; - private static final String CLOSE_LIST_ELEMENT = ""; - private static final String CLOSE_ORDERED_LIST = ""; - private static final String REGEX_NOT_CHAR_NUM_OR_UNDERSCORE = "[^a-zA-Z0-9_]"; - private static final String OPEN_BLOCKQUOTE = "
    "; - private static final String OPEN_DEFINITION_LIST = "
    "; - private static final String OPEN_LIST_ELEMENT = "
  • "; - private static final String OPEN_ORDERED_LIST = "
      "; - private static final String PIPE_ESCAPED = "|"; - private static final String WIKI_CLOSE_LINK = "]]"; - private static final String WIKI_OPEN_LINK = "[["; - + + private static final char ONE = '1'; + private static final char THREE = '3'; + private static final char TWO = '2'; + private static final char WIKI_FORMATTED = ' '; + private static final char WIKI_INDENTION = ':'; + private static final int LEN_WIKI_CLOSE_PRE_ESCAPED = WIKI_CLOSE_PRE_ESCAPED.length(); private static final int LEN_WIKI_OPEN_PRE_ESCAPED = WIKI_OPEN_PRE_ESCAPED.length(); private static final int LEN_WIKI_OPEN_LINK = WIKI_OPEN_LINK.length(); @@ -292,21 +297,21 @@ public class wikiCode extends abstractWikiParser implements wikiParser { //# sorted Lists contributed by [AS] //## Sublist if (line.startsWith(numberedListLevel + "#")) { //more # - line = OPEN_ORDERED_LIST + serverCore.CRLF_STRING - + OPEN_LIST_ELEMENT + line = HTML_OPEN_ORDERED_LIST + serverCore.CRLF_STRING + + HTML_OPEN_LIST_ELEMENT + line.substring(numberedListLevel.length() + 1, line.length()) - + CLOSE_LIST_ELEMENT; + + HTML_CLOSE_LIST_ELEMENT; numberedListLevel += "#"; } else if (numberedListLevel.length() > 0 && line.startsWith(numberedListLevel)) { //equal number of # - line = OPEN_LIST_ELEMENT + line = HTML_OPEN_LIST_ELEMENT + line.substring(numberedListLevel.length(), line.length()) - + CLOSE_LIST_ELEMENT; + + HTML_CLOSE_LIST_ELEMENT; } else if (numberedListLevel.length() > 0) { //less # int i = numberedListLevel.length(); String tmp = EMPTY; while (!line.startsWith(numberedListLevel.substring(0, i))) { - tmp += CLOSE_ORDERED_LIST; + tmp += HTML_CLOSE_ORDERED_LIST; i--; } numberedListLevel = numberedListLevel.substring(0, i); @@ -315,9 +320,9 @@ public class wikiCode extends abstractWikiParser implements wikiParser { if (numberedListLevel.length() > 0) { line = tmp - + OPEN_LIST_ELEMENT + + HTML_OPEN_LIST_ELEMENT + line.substring(positionOfOpeningTag, positionOfClosingTag) - + CLOSE_LIST_ELEMENT; + + HTML_CLOSE_LIST_ELEMENT; } else { line = tmp + line.substring(positionOfOpeningTag, positionOfClosingTag); } @@ -337,21 +342,21 @@ public class wikiCode extends abstractWikiParser implements wikiParser { if (!noList) { //lists only get processed if not forbidden (see code for [= and
      ). [MN]
                   //contributed by [AS]
                   if (line.startsWith(unorderedListLevel + ASTERISK)) { //more stars
      -                line = OPEN_UNORDERED_LIST + serverCore.CRLF_STRING
      -                        + OPEN_LIST_ELEMENT
      +                line = HTML_OPEN_UNORDERED_LIST + serverCore.CRLF_STRING
      +                        + HTML_OPEN_LIST_ELEMENT
                               + line.substring(unorderedListLevel.length() + 1, line.length())
      -                        + CLOSE_LIST_ELEMENT;
      +                        + HTML_CLOSE_LIST_ELEMENT;
                       unorderedListLevel += ASTERISK;
                   } else if (unorderedListLevel.length() > 0 && line.startsWith(unorderedListLevel)) { //equal number of stars
      -                line = OPEN_LIST_ELEMENT
      +                line = HTML_OPEN_LIST_ELEMENT
                               + line.substring(unorderedListLevel.length(), line.length())
      -                        + CLOSE_LIST_ELEMENT;
      +                        + HTML_CLOSE_LIST_ELEMENT;
                   } else if (unorderedListLevel.length() > 0) { //less stars
                       int i = unorderedListLevel.length();
                       String tmp = EMPTY;
       
                       while (unorderedListLevel.length() >= i && !line.startsWith(unorderedListLevel.substring(0, i))) {
      -                    tmp += CLOSE_UNORDERED_LIST;
      +                    tmp += HTML_CLOSE_UNORDERED_LIST;
                           i--;
                       }
                       int positionOfOpeningTag = unorderedListLevel.length();
      @@ -363,9 +368,9 @@ public class wikiCode extends abstractWikiParser implements wikiParser {
       
                       if (unorderedListLevel.length() > 0) {
                           line = tmp
      -                            + OPEN_LIST_ELEMENT
      +                            + HTML_OPEN_LIST_ELEMENT
                                   + line.substring(positionOfOpeningTag, positionOfClosingTag)
      -                            + CLOSE_LIST_ELEMENT;
      +                            + HTML_CLOSE_LIST_ELEMENT;
                       } else {
                           line = tmp + line.substring(positionOfOpeningTag, positionOfClosingTag);
                       }
      @@ -393,11 +398,11 @@ public class wikiCode extends abstractWikiParser implements wikiParser {
                       if ((positionOfOpeningTag = copyOfLine.indexOf(":")) > 0) {
                           definitionItem = copyOfLine.substring(0, positionOfOpeningTag);
                           definitionDescription = copyOfLine.substring(positionOfOpeningTag + 1);
      -                    line = OPEN_DEFINITION_LIST +
      -                            OPEN_DEFINITION_ITEM +
      +                    line = HTML_OPEN_DEFINITION_LIST +
      +                            HTML_OPEN_DEFINITION_ITEM +
                                   definitionItem +
      -                            CLOSE_DEFINITION_ITEM +
      -                            OPEN_DEFINITION_DESCRIPTION +
      +                            HTML_CLOSE_DEFINITION_ITEM +
      +                            HTML_OPEN_DEFINITION_DESCRIPTION +
                                   definitionDescription;
                           processingDefList = true;
                       }
      @@ -411,10 +416,10 @@ public class wikiCode extends abstractWikiParser implements wikiParser {
                       if ((positionOfOpeningTag = copyOfLine.indexOf(":")) > 0) {
                           definitionItem = copyOfLine.substring(0, positionOfOpeningTag);
                           definitionDescription = copyOfLine.substring(positionOfOpeningTag + 1);
      -                    line = OPEN_DEFINITION_ITEM +
      +                    line = HTML_OPEN_DEFINITION_ITEM +
                                   definitionItem +
      -                            CLOSE_DEFINITION_ITEM +
      -                            OPEN_DEFINITION_DESCRIPTION +
      +                            HTML_CLOSE_DEFINITION_ITEM +
      +                            HTML_OPEN_DEFINITION_DESCRIPTION +
                                   definitionDescription;
                           processingDefList = true;
                       }
      @@ -424,7 +429,7 @@ public class wikiCode extends abstractWikiParser implements wikiParser {
                       int i = defListLevel.length();
                       String tmp = EMPTY;
                       while (!line.startsWith(defListLevel.substring(0, i))) {
      -                    tmp = CLOSE_DEFINITION_DESCRIPTION + CLOSE_DEFINITION_LIST;
      +                    tmp = HTML_CLOSE_DEFINITION_DESCRIPTION + HTML_CLOSE_DEFINITION_LIST;
                           i--;
                       }
                       defListLevel = defListLevel.substring(0, i);
      @@ -435,7 +440,7 @@ public class wikiCode extends abstractWikiParser implements wikiParser {
                           if ((positionOfOpeningTag = copyOfLine.indexOf(":")) > 0) {
                               definitionItem = copyOfLine.substring(0, positionOfOpeningTag);
                               definitionDescription = copyOfLine.substring(positionOfOpeningTag + 1);
      -                        line = tmp + OPEN_DEFINITION_ITEM + definitionItem + CLOSE_DEFINITION_ITEM + OPEN_DEFINITION_DESCRIPTION + definitionDescription;
      +                        line = tmp + HTML_OPEN_DEFINITION_ITEM + definitionItem + HTML_CLOSE_DEFINITION_ITEM + HTML_OPEN_DEFINITION_DESCRIPTION + definitionDescription;
                               processingDefList = true;
                           }
                       } else {
      @@ -588,7 +593,7 @@ public class wikiCode extends abstractWikiParser implements wikiParser {
                   //taking care of indented lines
                   while (line.substring(preindented, positionOfOpeningTag).charAt(0) == WIKI_INDENTION) {
                       preindented++;
      -                openBlockQuoteTags.append(OPEN_BLOCKQUOTE);
      +                openBlockQuoteTags.append(HTML_OPEN_BLOCKQUOTE);
                   }
                   line = processLineOfWikiCode(line.substring(preindented, positionOfOpeningTag).replaceAll("!pre!", "!pre!!") + "!pre!txt!");
                   line = openBlockQuoteTags + line.replaceAll("!pre!txt!", preformattedText);
      @@ -602,7 +607,7 @@ public class wikiCode extends abstractWikiParser implements wikiParser {
                   preformattedText = preformattedText.replaceAll("!pre!", "!pre!!");
                   //taking care of indented lines
                   while (preindented > 0) {
      -                endBlockQuoteTags.append(CLOSE_BLOCKQUOTE);
      +                endBlockQuoteTags.append(HTML_CLOSE_BLOCKQUOTE);
                       preindented--;
                   }
                   line = processLineOfWikiCode("!pre!txt!" + line.substring(positionOfOpeningTag + LEN_WIKI_CLOSE_PRE_ESCAPED).replaceAll("!pre!", "!pre!!"));
      @@ -706,7 +711,7 @@ public class wikiCode extends abstractWikiParser implements wikiParser {
                           directory.append("\" class=\"WikiTOC\">");
                           directory.append(element);
                           directory.append("
      \n"); -} + } anchorext = EMPTY; } directory.append("\n"); @@ -728,16 +733,22 @@ public class wikiCode extends abstractWikiParser implements wikiParser { */ //[MN] private String pairReplace(String input, final String pat, final String repl1, final String repl2) { + return pairReplace(input, pat, pat, repl1, repl2); + } + + private String pairReplace(String input, final String pat1, final String pat2, + final String repl1, final String repl2) { String direlem = null; //string to keep headlines until they get added to List dirElements int firstPosition; final int secondPosition; - final int strLen = pat.length(); + final int pat1Len = pat1.length(); + final int pat2Len = pat2.length(); //replace pattern if a pair of the pattern can be found in the line - if (((firstPosition = input.indexOf(pat)) >= 0) && ((secondPosition = input.indexOf(pat, firstPosition + strLen)) >= 0)) { + if (((firstPosition = input.indexOf(pat1)) >= 0) && ((secondPosition = input.indexOf(pat2, firstPosition + pat1Len)) >= 0)) { //extra treatment for headlines - if (Arrays.binarySearch(HEADLINE_TAGS, pat) >= 0) { + if (Arrays.binarySearch(HEADLINE_TAGS, pat1) >= 0) { //add anchor and create headline - direlem = input.substring(firstPosition + strLen, secondPosition); + direlem = input.substring(firstPosition + pat1Len, secondPosition); if (direlem != null) { //counting double headlines int doubles = 0; @@ -755,21 +766,21 @@ public class wikiCode extends abstractWikiParser implements wikiParser { anchor = anchor + "_" + (doubles + 1); } input = input.substring(0, firstPosition) + "" + repl1 - + direlem + repl2 + input.substring(secondPosition + strLen); + + direlem + repl2 + input.substring(secondPosition + pat2Len); //add headlines to list of headlines (so TOC can be created) - if (Arrays.binarySearch(HEADLINE_TAGS, pat) >= 0) { - tableOfContentElements.add((pat.length() - 1) + direlem); + if (Arrays.binarySearch(HEADLINE_TAGS, pat1) >= 0) { + tableOfContentElements.add((pat1Len - 1) + direlem); } } } else { input = input.substring(0, firstPosition) + repl1 - + (input.substring(firstPosition + strLen, secondPosition)) + repl2 - + input.substring(secondPosition + strLen); + + (input.substring(firstPosition + pat1Len, secondPosition)) + repl2 + + input.substring(secondPosition + pat2Len); } } //recursion if another pair of the pattern can still be found in the line - if (((firstPosition = input.indexOf(pat)) >= 0) && (input.indexOf(pat, firstPosition + strLen) >= 0)) { - input = pairReplace(input, pat, repl1, repl2); + if (((firstPosition = input.indexOf(pat1)) >= 0) && (input.indexOf(pat2, firstPosition + pat1Len) >= 0)) { + input = pairReplace(input, pat1, pat2, repl1, repl2); } return input; } @@ -806,8 +817,8 @@ public class wikiCode extends abstractWikiParser implements wikiParser { final StringBuilder head = new StringBuilder(); final StringBuilder tail = new StringBuilder(); while (line.length() > 0 && line.charAt(0) == WIKI_INDENTION) { - head.append(OPEN_BLOCKQUOTE); - tail.append(CLOSE_BLOCKQUOTE); + head.append(HTML_OPEN_BLOCKQUOTE); + tail.append(HTML_CLOSE_BLOCKQUOTE); line = line.substring(1); } line = head + line + tail; @@ -823,6 +834,8 @@ public class wikiCode extends abstractWikiParser implements wikiParser { line = pairReplace(line, WIKI_EMPHASIZE_2, "", ""); line = pairReplace(line, WIKI_EMPHASIZE_1, "", ""); + line = pairReplace(line, WIKI_OPEN_STRIKE, WIKI_CLOSE_STRIKE, "", ""); + line = processUnorderedList(line); line = processOrderedList(line); line = processDefinitionList(line); @@ -834,7 +847,7 @@ public class wikiCode extends abstractWikiParser implements wikiParser { if (!processingPreformattedText) { replacedHtmlAlready = false; } - if (!(line.endsWith(CLOSE_LIST_ELEMENT) || processingDefList || escape || processingPreformattedText || processingTable || processingCell)) { + if (!(line.endsWith(HTML_CLOSE_LIST_ELEMENT) || processingDefList || escape || processingPreformattedText || processingTable || processingCell)) { line += "
      "; } return line;