Unverified Commit d3813ac3 authored by Neil C Smith's avatar Neil C Smith Committed by GitHub
Browse files

Merge pull request #2722 from matthiasblaesing/nb-css

[NETBEANS-5304] CSS: Prevent UI blocking on undocumented properties
parents 12b4f7de 4135fe82
......@@ -57,7 +57,7 @@ public class StandardPropertiesHelpResolver extends HelpResolver {
private static final String W3C_SPEC_URL_PREFIX = "http://www.w3.org/TR/"; //NOI18N
private static final String MODULE_ARCHIVE_PATH = "www.w3.org/TR/"; //NOI18N
private static final String INDEX_HTML_FILE_NAME = "index.html"; //NOI18N
private static final String NO_HELP_MSG = NbBundle.getMessage(StandardPropertiesHelpResolver.class, "completion-help-no-documentation-found");
@Override
......@@ -171,24 +171,8 @@ public class StandardPropertiesHelpResolver extends HelpResolver {
} else {
//no pattern found, likely a bit different source
LOGGER.warning(String.format("No property anchor section pattern found for property '%s'", property.getName())); //NOI18N
//strip the <style>...</style> section from the source since it causes a garbage in the swingbrowser
int styleSectionStart = urlContent.indexOf("<style type=\"text/css\">"); //NOI18N
if(styleSectionStart >= 0) {
final String styleEndTag = "</style>"; //NOI18N
int styleSectionEnd = urlContent.indexOf(styleEndTag, styleSectionStart);
if(styleSectionEnd >= 0) {
StringBuilder buf = new StringBuilder();
buf.append(urlContent.subSequence(0, styleSectionStart));
buf.append(urlContent.subSequence(styleSectionEnd + styleEndTag.length(), urlContent.length()));
return buf.toString();
}
}
return urlContent;
LOGGER.warning(String.format("No property anchor section pattern found for property '%s'", propertyUrl)); //NOI18N
return NO_HELP_MSG;
}
} catch (MalformedURLException ex) {
LOGGER.log(Level.WARNING, null, ex);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment