// wikiCode.java // ------------------------------------- // part of YACY // // (C) 2005, 2006 by Alexander Schier, Marc Nause, Franz Brausze // // $LastChangedDate$ // $LastChangedRevision$ // $LastChangedBy$ // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA package de.anomic.data.wiki; import java.io.BufferedReader; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import net.yacy.document.parser.html.CharacterCoding; import de.anomic.server.serverCore; /** This class provides methods to handle texts that have been posted in the yacyWiki or other * parts of YaCy that use this class, like the blog or the profile. * * @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 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_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 = "