Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Merged
merged 1 commit into from

2 participants

@jhinkey

No description provided.

@sez11a sez11a merged commit 87a5836 into sez11a:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 17, 2012
  1. @jhinkey
This page is out of date. Refresh to see the latest.
View
13 code/liferay-doc-utils/src/com/liferay/documentation/util/NumberHeadersTask.java
@@ -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);
View
BIN  lib/liferay-doc-utils.jar
Binary file not shown
Something went wrong with that request. Please try again.