jh: fix Tidy during migration by removing leading whitespace
diff --git a/org.eclipse.epf.common/src/org/eclipse/epf/common/html/HTMLFormatter.java b/org.eclipse.epf.common/src/org/eclipse/epf/common/html/HTMLFormatter.java
index e4a0628..42d4e9d 100644
--- a/org.eclipse.epf.common/src/org/eclipse/epf/common/html/HTMLFormatter.java
+++ b/org.eclipse.epf.common/src/org/eclipse/epf/common/html/HTMLFormatter.java
@@ -46,6 +46,8 @@
private int indentSize;
private String lastErrorStr;
+
+ private static final Pattern p_whitespace = Pattern.compile("^\\s+", Pattern.MULTILINE);
/*
* String location = m.group(1);
@@ -277,4 +279,8 @@
public String getLastErrorStr() {
return lastErrorStr;
}
+
+ public static String removeLeadingWhitespace(String input) {
+ return p_whitespace.matcher(input).replaceAll("");
+ }
}
diff --git a/org.eclipse.epf.library.xmi/src/org/eclipse/epf/library/xmi/internal/migration/MigrationUtil.java b/org.eclipse.epf.library.xmi/src/org/eclipse/epf/library/xmi/internal/migration/MigrationUtil.java
index 0d53756..ac552b1 100644
--- a/org.eclipse.epf.library.xmi/src/org/eclipse/epf/library/xmi/internal/migration/MigrationUtil.java
+++ b/org.eclipse.epf.library.xmi/src/org/eclipse/epf/library/xmi/internal/migration/MigrationUtil.java
@@ -113,7 +113,10 @@
String str0 = validateGuidAttribute((String) value);
String str1 = ResourceHelper.validateContent(element, str0);
- newValue = formater.formatHTML((String) str1);
+ // strip leading spaces so Tidy will properly indent
+ String str2 = HTMLFormatter.removeLeadingWhitespace(str1);
+
+ newValue = formater.formatHTML(str2);
if (localDebug) {
System.out.println("LD> feature: " + feature.getName());//$NON-NLS-1$
diff --git a/org.eclipse.epf.migration.diagram/META-INF/MANIFEST.MF b/org.eclipse.epf.migration.diagram/META-INF/MANIFEST.MF
index 3e215cd..141f352 100644
--- a/org.eclipse.epf.migration.diagram/META-INF/MANIFEST.MF
+++ b/org.eclipse.epf.migration.diagram/META-INF/MANIFEST.MF
@@ -19,3 +19,4 @@
Eclipse-LazyStart: true
Bundle-Vendor: %providerName
Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.epf.migration.diagram.util