diff --git a/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/HtmlProcessor.java b/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/HtmlProcessor.java index 036324b..b791deb 100644 --- a/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/HtmlProcessor.java +++ b/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/HtmlProcessor.java @@ -156,6 +156,9 @@ public HtmlProcessor(FileResourceProvider fileResourceProvider, LocalizationSett } public String processHtmlForPDF(@NotNull String html, @NotNull ExportParams exportParams, @NotNull List selectedRoleEnumValues) { + // Replace all dollar-characters in HTML document before applying any regular expressions, as it has special meaning there + html = html.replaceAll("\\$", "$"); + html = removePd4mlTags(html); html = html.replace("/ria/images/enums/", "/icons/default/enums/"); html = html.replace("


", "
"); @@ -559,13 +562,13 @@ private String removePd4mlTags(@NotNull String html) { @SuppressWarnings({"java:S5869", "java:S6019"}) String properTableHeads(@NotNull String html) { // Searches for all subsequent table rows (-tags) inside which contain -tags - // followed by a row which doesn't contain . + // followed by a row which doesn't contain (or closing tag). // There are 2 groups in this regexp, first one is unnamed, containing and -tags containing -tags, // second one is named ("header") and contains those -tags which include -tags. The regexp is ending // by positive lookahead "(?=-tags containing -tags and move it from into , // for table headers to repeat on each page. - Pattern pattern = Pattern.compile("([^<]*(?
[^<]*[^<]*(?
[^<]*