Confluence Wiki - Escape special characters (#11786)

The Confluence Markup needs to escape some characters.
This commit is contained in:
chatelao 2022-03-04 16:15:22 +01:00 committed by GitHub
parent 5128e88f5f
commit 79d9193374
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -148,7 +148,11 @@ public class ConfluenceWikiCodegen extends DefaultCodegen implements CodegenConf
}
// chomp tailing newline because it breaks the tables and keep all other sign to show documentation properly
return StringUtils.chomp(input);
return StringUtils.chomp(input.replace("\\", "\\\\")
.replace("{", "\\{").replace("}", "\\}")
.replace("]", "\\]")
.replace("|", "\\|")
.replace("!", "\\!"));
}
@Override