PDF link page autocompletion inconsistent

Steps to reproduce

  • Add a PDF attachment (here referred to as “filename.pdf”) to your Vault
  • From a Note, start creating an internal link by writing [[filen

To demonstrate the inconsistency you can now either
(a)

  • Press tab to autocomplete the internal Link to [[filename.pdf]]
  • Add a # character at the end of filename.pdf
  • Note that nothing happens. Entering a number right now will not link to that pdf page, as pdf page links have to be created via #page=num and not #num
  • … manually write out #page=num

or (b)

  • Write out [[filename.pdf]] without tab-completing the filename
  • press # after finishing writing pdf
  • Observe that #page= is inserted automatically
    Further observation:
  • After tab completing, #page= will be inserted if the last character (f) is removed and retyped manually before typing the #

Expected result

#page= should be inserted when pressing # at the end of a pdf link

Actual result

#page= is not inserted if the filename was tab-completed

Environment

  • Operating system: Windows 10
  • Debug info:
    SYSTEM INFO:
    Obsidian version: v1.0.3
    Installer version: v0.15.9
    Operating system: Windows 10 Pro 10.0.19042
    Login status: not logged in
    Insider build toggle: off
    Live preview: on
    Legacy editor: off
    Base theme: dark
    Community theme: none
    Snippets enabled: 0
    Restricted mode: on

RECOMMENDATIONS:
none
(Tested in Sandbox Vault)


Additional information

I have the same Issue on Windows 10 using Obsidian v1.1.9

However the inconsistency does not correspond to tab-completion with me. It rather seems to work for some pdfs but not others.

So I type [[some-pdf hit tab, which autocompletes to [[some-pdf-I-want-to-link-to.pdf]] with the cursor before the double closing brackets, press # and it autocompletes to [[some-pdf-I-want-to-link-to.pdf#page=]].

But typing [[another-pdf hit tab, which autocompletes to [[another-pdf-where-completion-does-not-work.pdf]], press # and it ends in [[some-pdf-I-want-to-link-to.pdf#]] with the cursor before the double closing brackets.

It does seem to auto-insert #page= when I retype the f and then # as you described.