show pagenr in hover decoration

This commit is contained in:
Ruben van de Ven 2022-11-11 12:07:56 +01:00
parent d9bc42d464
commit ee8a1cc681

View file

@ -36,7 +36,8 @@ function updateDecorations() {
const uriArguments = `?${encodeURIComponent(JSON.stringify([reference]))}`; const uriArguments = `?${encodeURIComponent(JSON.stringify([reference]))}`;
const pdfCommandUri = Uri.parse(`command:zoterolens.openZoteroPDF`+uriArguments); const pdfCommandUri = Uri.parse(`command:zoterolens.openZoteroPDF`+uriArguments);
const viewCommandUri = Uri.parse(`command:zoterolens.showInZotero`+uriArguments); const viewCommandUri = Uri.parse(`command:zoterolens.showInZotero`+uriArguments);
const contents = new MarkdownString(`${reference.citekey}\n\n[View in Zotero](${viewCommandUri}) | [Open PDF](${pdfCommandUri})`); const pageNr = reference.pagenr === null ? "" : `(${reference.pagenr})`;
const contents = new MarkdownString(`${reference.citekey} ${pageNr}\n\n[View in Zotero](${viewCommandUri}) | [Open PDF](${pdfCommandUri})`);
// To enable command URIs in Markdown content, you must set the `isTrusted` flag. // To enable command URIs in Markdown content, you must set the `isTrusted` flag.
// When creating trusted Markdown string, make sure to properly sanitize all the // When creating trusted Markdown string, make sure to properly sanitize all the