Auto-detect square brackets when creating a link

User behaviour:

  • While writing in Logseq, I often want to link to a page, but display the text differently (create an alias that only lasts this instance).
  • I will also often “bury” a link in an asterisk to create the linkage without fully displaying the text in the block. (e.g. [*]([[Page Link]]))

Desired behaviour:

  • When text is highlighted that contains a link already ([[]] or web address), and the link shortcut is pressed, wrap the link in round brackets () and place the cursor before the link surrounded by square brackets — [*cursor here*]([[Page Link]])

Current behaviour:

  • When text is highlighted that contains a link already ([[]] or web address), and the link shortcut is pressed, Logseq wraps the link in square brackets [] — [[[Page Link]]]()