Skip to content

Commit 366a501

Browse files
Fix PDF pages in citations as not all knowledge retrievals report page data for PDF (#395)
1 parent 04719a9 commit 366a501

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

OnGeneratedResponse/swap-citations.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@ beginDialog:
4747
),
4848
Substitute((Topic.externalWebsiteURL & currentRecord.Name), " ", "%20") &
4949
If(
50-
// check if cited source is a PDF
51-
EndsWith(currentRecord.Name,".pdf"),
50+
// check if cited source is a PDF and we have page data available
51+
And(
52+
EndsWith(currentRecord.Name, ".pdf"),
53+
StartsWith(currentRecord.Text, "<page value=")
54+
),
5255
// add page for PDFs
5356
"#page=" & Mid(
5457
currentRecord.Text,

0 commit comments

Comments
 (0)