Skip to content

Commit

Permalink
Merge pull request #42039 from gsmet/fix-downstream-title
Browse files Browse the repository at this point in the history
Make sure we append the current buffer before appending the title
  • Loading branch information
gsmet authored Jul 22, 2024
2 parents 78fdb1d + 6dc20b6 commit 885372b
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,15 @@ private static void copyAsciidoc(Path sourceFile, Path targetFile, Set<String> d
lineNumber++;

if (!documentTitleFound && line.startsWith("= ")) {
// anything in the buffer needs to be appended
// we don't need to rewrite it as before the title we can only have the preamble
// and we don't want to change anything in the preamble
// if at some point we want to adjust the preamble, make sure to do it in a separate method and not reuse rewriteContent
if (currentBuffer.length() > 0) {
rewrittenGuide.append(currentBuffer);
currentBuffer.setLength(0);
}

// this is the document title
rewrittenGuide.append(line.replace(PROJECT_NAME_ATTRIBUTE, RED_HAT_BUILD_OF_QUARKUS) + "\n");
documentTitleFound = true;
Expand Down

0 comments on commit 885372b

Please sign in to comment.