import net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin;
import net.sourceforge.phpeclipse.wiki.internal.Configuration;
import net.sourceforge.phpeclipse.wiki.preferences.Util;
+import net.sourceforge.phpeclipse.wiki.renderer.StringUtil;
import net.sourceforge.phpeclipse.wiki.velocity.EditorText;
import net.sourceforge.phpeclipse.wiki.xml.Page;
import net.sourceforge.phpeclipse.wiki.xml.XStreamManager;
wikiURLTitle = Util.getURLWikiName(file);
String body = StoreWikipediaAction.getInputStreamAsString(is, wikipedia.getCharSet());
char ch;
- boolean noContent = checkNoContent(body);
+ boolean noContent = StringUtil.checkNoContent(body);
String srcBasePath = Util.getWikiTextsPath(file);
String binBasePath = Util.getProjectsWikiOutputPath(file.getProject(), WikiEditorPlugin.HTML_OUTPUT_PATH);
return Status.CANCEL_STATUS;
}
- /**
- * @param body
- * @param j
- * @return
- */
- private boolean checkNoContent(String body) {
- char ch;
- boolean noContent = true;
- int j = 0;
- try {
- while (true) {
- ch = body.charAt(j++);
- if (!Character.isWhitespace(ch)) {
- if (ch == '<' && body.charAt(j) == '!' && body.charAt(j + 1) == '-' && body.charAt(j + 2) == '-') {
- //<!-- ... -->
- j += 3;
- while (true) {
- ch = body.charAt(j++);
- if (ch == '-' && body.charAt(j) == '-' && body.charAt(j + 1) == '>') {
- j += 2;
- break;
- }
- }
- } else if (ch == '<' && body.charAt(j) == 'b' && body.charAt(j + 1) == 'r' && body.charAt(j + 2) == '>') {
- // <br>
- } else {
- noContent = false;
- break;
- }
- }
- }
- } catch (IndexOutOfBoundsException e) {
-
- }
- return noContent;
- }
-
public boolean isModal(Job job) {
Boolean isModal = (Boolean) job.getProperty(IProgressConstants.PROPERTY_IN_DIALOG);
if (isModal == null) {