basham / obsidian-alias-from-heading

Obsidian plugin: Implicitly add an alias matching the first heading in a document.
MIT License
16 stars 1 forks source link

alias change not working when there is inner heading link #10

Closed cmasfo closed 4 months ago

cmasfo commented 5 months ago
# HEADING

* [[#SUBHEADING1]]
* [[#SUBHEADING2]]

## SUBHEADING2

## SUBHEADING2

If I write like that, the auto alias change stop working.

basham commented 5 months ago

Are you saying the alias of the primary heading (HEADING) is not working or that the aliases of the subheadings (SUBHEADING1, SUBHEADING2) aren't working?

cmasfo commented 5 months ago

using title as alias still works

but i mean the feature 'auto alias change when its title changes'

it stops working when i have subheading link like this:

original:

// dst_file
# OLD_HEADING
->
# NEW_HEADING

// src_file
[[dst_file|OLD_HEADING]]
->
[[dst_file|NEW_HEADING]] // auto change

having subheading link:

// dst_file
# OLD_HEADING
* [[#subheading]] // heading link
->
# NEW_HEADING // title change
* [[#subheading]]

// src_file
[[dst_file|OLD_HEADING]]
->
[[dst_file|OLD_HEADING]] // no change

additionally, i've just found just having that kind of link inside post make auto alias change stop working for all links inside of that post, no matter if it's in dst_file or src_file. so it was not only for the certain link.

[[filename#one_of_its_heading|TITLE]] ^^^ this kind of link

so, in summary, it stops in two situations:

basham commented 4 months ago

This is resolved as of v1.1. Thanks for posting the issue!