[]( link expanding not properly when . , # ? at the end

Steps to reproduce

  1. Write a sentence like “this is a link.”
  2. Place the [ bracket like so: “this is a [link.”
  3. Place the ] bracket like so: “this is a [link].”
  4. Place the ( bracket like so: “this is a [link](.”

Expected result

After step 4 the […]( should automatically be expended to […] ().

Actual result

When there is a . or , or # or ? right after the ( bracket, it does not expand properly

Environment

  • Operating system: Windows 10 Home - v1909 - build 18363.836
  • Obsidian version: v0.6.4
  • Using custom CSS: /

Additional information

I have seen what I think is a variant of this. However, it is simply that having a ? at the end of a phrase in brackets does not create a new page

e.g.
[[New Page]] - will create a new page
[[New Page Also?]] - will NOT create a new page
but remove the ?
[[New Page Also}} - will create a new page

Did not see the same behavior with ! - i.e. it did create a new page

Some characters are not allowed in note title. Like ?
We’ll look into the other cases.

Upon rereading the bug report, I realize that maybe you are complaining because you not automatically getting the )
?

Yes this is correct, I find it a bit silly the automatic expanding happens normally. But it doesn’t happen in the above mentioned edge cases.

I think that’s from CodeMirror’s “auto pair brackets” feature, which adds the closing bracket but only if the next character isn’t a text character. Otherwise your steps would become:

  1. Write a sentence like “this is a link.”
  2. Place the [ bracket like so: “this is a [link.”
  3. Notice that ] is automatically inserted like so: “this is a []link.”

And that would be pretty annoying.

Yes, I totally understand the tradeoffs, fair point!
But if the [] is already present and you want to make I’m not sure it would be annoying if the ) would autocomplete:

  1. Write a sentence like “this is a link.”
  2. Place the [ bracket like so: “this is a [link.”
  3. Place the ] bracket like so: “this is a [link].”
  4. Place the ( bracket like so: “this is a [link](.”

Then it would be nice if it auto paired like so:
“this is a link.”

@KasperZutterman Can you use Ctrl/Cmd+K instead? That seems much faster than doing this.

1 Like

That does the job! Thanks

1 Like

I’ll move this to the graveyard for now (not locked), until someone else reports it. Thanks!