Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fail numbering markdown headers if header text is blank. #186

Merged
merged 1 commit into from

2 participants

Jim Hinkey Rich Sezov
Jim Hinkey

No description provided.

Rich Sezov sez11a merged commit 87a5836 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 17, 2012
  1. Jim Hinkey
This page is out of date. Refresh to see the latest.
13 code/liferay-doc-utils/src/com/liferay/documentation/util/NumberHeadersTask.java
View
@@ -136,7 +136,9 @@ private String extractChapterNumber(String fileName) {
return chapter;
}
- private String handleHeaderLine(String line, String filename, int lineNum, Properties props) {
+ private String handleHeaderLine(String line, String filename, int lineNum,
+ Properties props) throws BuildException {
+
String newHeadingLine = null;
// Check if the header contains an ID
@@ -180,7 +182,14 @@ private String handleHeaderLine(String line, String filename, int lineNum, Prop
}
}
- String heading = extractHeading(line, indexOfFirstHeaderChar);
+ String heading = null;
+ if (indexOfFirstHeaderChar > 0) {
+ heading = extractHeading(line, indexOfFirstHeaderChar);
+ }
+ else {
+ throw new BuildException("WARNING - " + filename + ":" +
+ lineNum + " is missing header text.");
+ }
String chapter = extractChapterNumber(filename);
BIN  lib/liferay-doc-utils.jar
View
Binary file not shown
Something went wrong with that request. Please try again.