Creating links in a canvas note does not follow the "New link format = Relative path to file" configuration option

Steps to reproduce

  1. Create a new empty vault
  2. In the vault preference, set “Files & Links” → “New link format” to “Relative path to file”
  3. Create a folder testfolder in the vault
  4. Create a text file testfile in folder testfolder
  5. Create a canvas testcanvas in folder testfolder
  6. In the canvas, create a note, press [[ to launch the file selection, and select testfile.

Expected result

Since the file is in the same folder as the canvas, the link should be created as testfile.

Actual result

The link is created as testfolder/testfile

Environment

  • Operating system:
    macOS 12.6.2

  • Debug info:
    SYSTEM INFO:
    Obsidian version: v1.1.16
    Installer version: v1.1.9
    Operating system: Darwin Kernel Version 21.6.0: Sun Nov 6 23:31:16 PST 2022; root:xnu-8020.240.14~1/RELEASE_X86_64 21.6.0
    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

Additional information

This works correctly if we create the link from a text file. The bug only exists if we create the link from a canvas.

thanks