RyotaUshio / obsidian-pdf-plus

PDF++: The most Obsidian-native PDF annotation, viewing & editing tool ever. Comes with optional Vim keybindings.
https://ryotaushio.github.io/obsidian-pdf-plus/
MIT License
823 stars 15 forks source link

[Bug] Supplementary to #73 #77

Closed math-feng closed 8 months ago

math-feng commented 8 months ago

Steps to reproduce

see the GIF on the above

Expected behavior

display properly

Actual behavior

I did what you said, turned off most plugins and css, and theme selected as default.

The current situation is that the mismatch between what is boxed and what is pasted still exists, but only on the PDF I emailed you. Other than that, the boxed content is not highlighted after the link is pasted.

Screen recordings or screenshots (sandbox vault)

2024_03_03_11_03_59

Obsidian debug info

SYSTEM INFO: Obsidian version: v1.5.8 Installer version: v1.5.3 Operating system: Windows 10 Home China 10.0.22635 Login status: not logged in Insider build toggle: off Live preview: on Base theme: adapt to system Community theme: none Snippets enabled: 1 Restricted mode: off Plugins installed: 53 Plugins enabled: 3 1: Remotely Save v0.3.40 2: PDF++ v0.37.0 3: MathLinks v0.5.3

RECOMMENDATIONS: Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets. Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

PDF++ debug info

{
    "settings": {
        "displayTextFormats": [
            {
                "name": "Obsidian default",
                "template": "{{file.basename}}, page {{page}}"
            },
            {
                "name": "Title & page",
                "template": "{{file.basename}}, p.{{pageLabel}}"
            },
            {
                "name": "Page only",
                "template": "p.{{pageLabel}}"
            },
            {
                "name": "Text",
                "template": "{{text}}"
            }
        ],
        "defaultDisplayTextFormatIndex": 0,
        "syncDisplayTextFormat": true,
        "syncDefaultDisplayTextFormat": true,
        "copyCommands": [
            {
                "name": "Quote",
                "template": "> ({{linkWithDisplay}})\n> {{selection}}\n"
            },
            {
                "name": "Link only",
                "template": "{{linkWithDisplay}}"
            },
            {
                "name": "Embed",
                "template": "!{{link}}"
            },
            {
                "name": "Callout",
                "template": "> [!{{calloutType}}|{{colorName}}] {{linkWithDisplay}}\n> {{text}}\n"
            },
            {
                "name": "Quote in callout",
                "template": "> [!{{calloutType}}|{{colorName}}] {{linkWithDisplay}}\n> > {{text}}\n> \n> "
            },
            {
                "name": "Create new note",
                "template": "{{app.vault.create(text + \".md\", linkWithDisplay).then((file) => app.workspace.getLeaf(true).openFile(file)), \"\"}}"
            }
        ],
        "useAnotherCopyTemplateWhenNoSelection": false,
        "copyTemplateWhenNoSelection": "{{linkToPageWithDisplay}}",
        "trimSelectionEmbed": true,
        "embedMargin": 50,
        "noSidebarInEmbed": true,
        "noSpreadModeInEmbed": true,
        "embedUnscrollable": true,
        "singleTabForSinglePDF": true,
        "highlightExistingTab": true,
        "existingTabHighlightOpacity": 0.5,
        "existingTabHighlightDuration": 0.75,
        "paneTypeForFirstPDFLeaf": "",
        "openLinkNextToExistingPDFTab": true,
        "openPDFWithDefaultApp": false,
        "openPDFWithDefaultAppAndObsidian": true,
        "focusObsidianAfterOpenPDFWithDefaultApp": true,
        "syncWithDefaultApp": false,
        "dontActivateAfterOpenPDF": true,
        "dontActivateAfterOpenMD": true,
        "highlightDuration": 0.75,
        "noTextHighlightsInEmbed": false,
        "noAnnotationHighlightsInEmbed": false,
        "persistentTextHighlightsInEmbed": true,
        "persistentAnnotationHighlightsInEmbed": true,
        "highlightBacklinks": true,
        "dblclickEmbedToOpenLink": true,
        "highlightBacklinksPane": true,
        "highlightOnHoverBacklinkPane": true,
        "backlinkHoverColor": "",
        "colors": {
            "Yellow": "#ffd000",
            "Red": "#ea5252",
            "Note": "#086ddd",
            "Important": "#bb61e5"
        },
        "defaultColor": "",
        "defaultColorPaletteItemIndex": 0,
        "syncColorPaletteItem": true,
        "syncDefaultColorPaletteItem": false,
        "colorPaletteInToolbar": true,
        "noColorButtonInColorPalette": false,
        "colorPaletteInEmbedToolbar": true,
        "showStatusInToolbar": true,
        "highlightColorSpecifiedOnly": false,
        "doubleClickHighlightToOpenBacklink": true,
        "hoverHighlightAction": "preview",
        "paneTypeForFirstMDLeaf": "window",
        "singleMDLeafInSidebar": true,
        "alwaysUseSidebar": true,
        "defaultColorPaletteActionIndex": 4,
        "syncColorPaletteAction": true,
        "syncDefaultColorPaletteAction": true,
        "proxyMDProperty": "PDF",
        "hoverPDFLinkToOpen": false,
        "ignoreHeightParamInPopoverPreview": true,
        "filterBacklinksByPageDefault": true,
        "showBacklinkToPage": true,
        "enableHoverPDFInternalLink": true,
        "recordPDFInternalLinkHistory": true,
        "alwaysRecordHistory": true,
        "renderMarkdownInStickyNote": true,
        "enablePDFEdit": false,
        "author": "",
        "writeHighlightToFileOpacity": 0.2,
        "defaultWriteFileToggle": false,
        "syncWriteFileToggle": true,
        "syncDefaultWriteFileToggle": false,
        "enableAnnotationDeletion": true,
        "warnEveryAnnotationDelete": false,
        "warnBacklinkedAnnotationDelete": true,
        "enableAnnotationContentEdit": true,
        "enableEditEncryptedPDF": false,
        "pdfLinkColor": "#04a802",
        "pdfLinkBorder": false,
        "replaceContextMenu": true,
        "executeBuiltinCommandForOutline": true,
        "executeBuiltinCommandForZoom": true,
        "executeFontSizeAdjusterCommand": true,
        "closeSidebarWithShowCommandIfExist": true,
        "outlineDrag": true,
        "outlineContextMenu": true,
        "outlineLinkDisplayTextFormat": "{{file.basename}}, {{text}}",
        "outlineLinkCopyFormat": "{{linkWithDisplay}}",
        "recordHistoryOnOutlineClick": true,
        "popoverPreviewOnOutlineHover": true,
        "thumbnailDrag": true,
        "thumbnailContextMenu": true,
        "thumbnailLinkDisplayTextFormat": "{{file.basename}}, page {{pageLabel}}",
        "thumbnailLinkCopyFormat": "{{linkWithDisplay}}",
        "recordHistoryOnThumbnailClick": true,
        "popoverPreviewOnThumbnailHover": true,
        "annotationPopupDrag": true,
        "useCallout": true,
        "calloutType": "PDF",
        "calloutIcon": "highlighter",
        "highlightBacklinksInEmbed": true,
        "highlightBacklinksInHoverPopover": true,
        "highlightBacklinksInCanvas": true,
        "clickPDFInternalLinkWithModifierKey": true,
        "clickOutlineItemWithModifierKey": true,
        "clickThumbnailWithModifierKey": true,
        "focusEditorAfterAutoPaste": true,
        "autoFocus": false,
        "autoFocusTarget": "last-active-and-open-then-last-paste",
        "autoPasteTarget": "last-active-and-open-then-last-paste",
        "openAutoFocusTargetIfNotOpened": true,
        "howToOpenAutoFocusTargetIfNotOpened": "right",
        "closeHoverEditorWhenLostFocus": true,
        "closeSidebarWhenLostFocus": true,
        "openAutoFocusTargetInEditingView": true,
        "executeCommandWhenTargetNotIdentified": true,
        "commandToExecuteWhenTargetNotIdentified": "pdf-plus:create-new-note",
        "selectToCopyToggleRibbonIcon": true,
        "autoFocusToggleRibbonIcon": true,
        "viewSyncFollowPageNumber": true,
        "viewSyncPageDebounceInterval": 0.3,
        "openAfterExtractPages": true,
        "howToOpenExtractedPDF": "tab",
        "warnEveryPageDelete": true,
        "warnBacklinkedPageDelete": true,
        "extractPageInPlace": false,
        "askExtractPageInPlace": true,
        "pageLabelUpdateWhenInsertPage": "keep",
        "pageLabelUpdateWhenDeletePage": "keep",
        "pageLabelUpdateWhenExtractPage": "keep",
        "askPageLabelUpdateWhenInsertPage": true,
        "askPageLabelUpdateWhenDeletePage": true,
        "askPageLabelUpdateWhenExtractPage": true,
        "copyOutlineAsListFormat": "{{linkWithDisplay}}",
        "copyOutlineAsListDisplayTextFormat": "{{text}}",
        "copyOutlineAsHeadingsFormat": "{{text}}\n\n{{linkWithDisplay}}",
        "copyOutlineAsHeadingsDisplayTextFormat": "p.{{pageLabel}}",
        "copyOutlineAsHeadingsMinLevel": 2,
        "newFileNameFormat": "",
        "newFileTemplatePath": "",
        "newPDFLocation": "current",
        "newPDFFolderPath": "",
        "rectEmbedStaticImage": false,
        "rectImageFormat": "file",
        "rectImageExtension": "png",
        "includeColorWhenCopyingRectLink": true,
        "backlinkIconSize": 50,
        "showBacklinkIconForSelection": true,
        "showBacklinkIconForAnnotation": true,
        "showBacklinkIconForOffset": true,
        "showBacklinkIconForRect": true,
        "showBoundingRectForBacklinkedAnnot": true,
        "hideReplyAnnotation": false,
        "autoHidePDFSidebar": true,
        "respectCursorPositionWhenAutoPaste": true
    },
    "styleSettings": null,
    "styleSheet": ".pdf-plus-backlink-highlight-layer .pdf-plus-backlink:not(.hovered-highlight)[data-highlight-color=\"yellow\"],\n.pdf-embed[data-highlight-color=\"yellow\"] .textLayer .mod-focused {\n    --pdf-plus-color: #ffd000;\n    --pdf-plus-backlink-icon-color: #ffd000;\n    --pdf-plus-rect-color: #ffd000;\n}\n.pdf-plus-backlink-highlight-layer .pdf-plus-backlink:not(.hovered-highlight)[data-highlight-color=\"red\"],\n.pdf-embed[data-highlight-color=\"red\"] .textLayer .mod-focused {\n    --pdf-plus-color: #ea5252;\n    --pdf-plus-backlink-icon-color: #ea5252;\n    --pdf-plus-rect-color: #ea5252;\n}\n.pdf-plus-backlink-highlight-layer .pdf-plus-backlink:not(.hovered-highlight)[data-highlight-color=\"note\"],\n.pdf-embed[data-highlight-color=\"note\"] .textLayer .mod-focused {\n    --pdf-plus-color: #086ddd;\n    --pdf-plus-backlink-icon-color: #086ddd;\n    --pdf-plus-rect-color: #086ddd;\n}\n.pdf-plus-backlink-highlight-layer .pdf-plus-backlink:not(.hovered-highlight)[data-highlight-color=\"important\"],\n.pdf-embed[data-highlight-color=\"important\"] .textLayer .mod-focused {\n    --pdf-plus-color: #bb61e5;\n    --pdf-plus-backlink-icon-color: #bb61e5;\n    --pdf-plus-rect-color: #bb61e5;\n}\n.pdf-plus-backlink-highlight-layer .pdf-plus-backlink:not(.hovered-highlight) {\n    --pdf-plus-color: rgb(var(--text-highlight-bg-rgb));\n    --pdf-plus-backlink-icon-color: rgb(var(--text-highlight-bg-rgb));\n    --pdf-plus-rect-color: rgb(var(--text-highlight-bg-rgb));\n}\n.pdf-plus-backlink-highlight-layer .pdf-plus-backlink.hovered-highlight {\n\t--pdf-plus-color: green;\n\t--pdf-plus-backlink-icon-color: green;\n   --pdf-plus-rect-color: green;\n}\n.pdf-plus-color-palette-item[data-highlight-color=\"yellow\"] > .pdf-plus-color-palette-item-inner {\n    background-color: #ffd000;\n}\n.pdf-plus-color-palette-item[data-highlight-color=\"red\"] > .pdf-plus-color-palette-item-inner {\n    background-color: #ea5252;\n}\n.pdf-plus-color-palette-item[data-highlight-color=\"note\"] > .pdf-plus-color-palette-item-inner {\n    background-color: #086ddd;\n}\n.pdf-plus-color-palette-item[data-highlight-color=\"important\"] > .pdf-plus-color-palette-item-inner {\n    background-color: #bb61e5;\n}\n.pdf-plus-color-palette-item:not([data-highlight-color]) > .pdf-plus-color-palette-item-inner {\n    background-color: transparent;\n}\n.workspace-leaf.pdf-plus-link-opened.is-highlighted::before {\n\topacity: 0.5;\n}\nbody {\n    --pdf-plus-yellow-rgb: 255, 208, 0\n}\nbody {\n    --pdf-plus-red-rgb: 234, 82, 82\n}\nbody {\n    --pdf-plus-note-rgb: 8, 109, 221\n}\nbody {\n    --pdf-plus-important-rgb: 187, 97, 229\n}\nbody {\n    --pdf-plus-default-color-rgb: var(--text-highlight-bg-rgb)\n}\n.callout[data-callout=\"pdf\"][data-callout-metadata=\"yellow\"] {\n\t--callout-color: var(--pdf-plus-yellow-rgb);\n   background-color: rgba(var(--callout-color), var(--pdf-plus-highlight-opacity, 0.2))\n}\n.callout[data-callout=\"pdf\"][data-callout-metadata=\"red\"] {\n\t--callout-color: var(--pdf-plus-red-rgb);\n   background-color: rgba(var(--callout-color), var(--pdf-plus-highlight-opacity, 0.2))\n}\n.callout[data-callout=\"pdf\"][data-callout-metadata=\"note\"] {\n\t--callout-color: var(--pdf-plus-note-rgb);\n   background-color: rgba(var(--callout-color), var(--pdf-plus-highlight-opacity, 0.2))\n}\n.callout[data-callout=\"pdf\"][data-callout-metadata=\"important\"] {\n\t--callout-color: var(--pdf-plus-important-rgb);\n   background-color: rgba(var(--callout-color), var(--pdf-plus-highlight-opacity, 0.2))\n}\n.callout[data-callout=\"pdf\"] {\n\t--callout-color: var(--pdf-plus-default-color-rgb);\n   background-color: rgba(var(--callout-color), var(--pdf-plus-highlight-opacity, 0.2))\n}\n.callout[data-callout=\"pdf\"] {\n   --callout-icon: lucide-highlighter;\n}"
}

Error messages

image

RyotaUshio commented 8 months ago

Obsidian debug info ... 2: PDF++ v0.37.0

You are using an old version of PDF++.

the mismatch between what is boxed and what is pasted

I have already fixed this in 0.37.6, so you will not see this problem after updating PDF++ to the latest version.

Can you report back after updating? Then I guess we can focus on the second problem where

the boxed content is not highlighted after the link is pasted.

RyotaUshio commented 8 months ago

Snippets enabled: 1

When you disable this CSS snippet, does the problem ("the boxed content is not highlighted after the link is pasted." ) disappear? If not, can you share the snippet?

1: Remotely Save v0.3.40 3: MathLinks v0.5.3

Are both of these plugins necessary to reproduce the problem ("the boxed content is not highlighted after the link is pasted")?

math-feng commented 8 months ago

Obsidian debug info ... 2: PDF++ v0.37.0

You are using an old version of PDF++.

the mismatch between what is boxed and what is pasted

I have already fixed this in 0.37.6, so you will not see this problem after updating PDF++ to the latest version.

Can you report back after updating? Then I guess we can focus on the second problem where

the boxed content is not highlighted after the link is pasted.

I met a strange thing, after I updated PDF++ to the latest version, when I restarted Obsidian, even changed back to the version 0.37, this is related to the BART plugin?

RyotaUshio commented 8 months ago

Thank you, that was due to my outdated BRAT config. I'm sorry for that.

Now you should be able to update to the latest version (0.37.9).

math-feng commented 8 months ago

That should be the problem then, so when I restart and update the plugin, the problem goes away, but after a while it comes back and I cry.

RyotaUshio commented 8 months ago

Do you mean "the mismatch between what is boxed and what is pasted" still exists in 0.37.10? If so it's strange...

But the bug that "the boxed content is not highlighted after the link is pasted" is expected to be there because I have not touched it yet.

math-feng commented 8 months ago

No, I mean it exists in 0.37.0

math-feng commented 8 months ago

Is there a shortcut command for marking rectangular areas, I can't find it!

RyotaUshio commented 8 months ago

No, I mean it exists in 0.37.0

It's because the release that I fixed the bug is 0.37.6 and you are on an older version.

Can you report back after updating to 0.37.10? Now the BRAT thing should be gone so I will be able to update without problems

math-feng commented 8 months ago

Everything is working fine at the moment and the problem no longer exists! in 0.37.9.

RyotaUshio commented 8 months ago

Wow, you mean both of them have gone, not just "the mismatch between what is boxed and what is pasted"?

math-feng commented 8 months ago

Yes, thank you very much.

RyotaUshio commented 8 months ago

Glad finally we could fix it:) Thanks for the report!