Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transcluding block ids transcludes whole note instead #112

Open
slnc opened this issue Jul 23, 2022 · 1 comment
Open

Transcluding block ids transcludes whole note instead #112

slnc opened this issue Jul 23, 2022 · 1 comment

Comments

@slnc
Copy link

slnc commented Jul 23, 2022

How to reproduce

Create two notes:

1.md:

Some text

Some highlights ^some-block-id

2.md:

![[1.md#^some-block-id]]

Expected result

Obsidian Export behaves like Obsidian, that is, it exports 2.md with the following content:

Some highlights

Actual result

Obsidian export transcludes the whole 1.md file:

Some text

Some highlights ^some-block-id

Workaround

Use headings instead of block ids, which Obsidian Export does export correctly. However hopefully this is easy to fix given that Obsidian Export already supports headings?

@y1450
Copy link

y1450 commented Jul 30, 2022

I am also interested in implementing this feature,but I am new to Rust. My idea is the implementation is not straight forward.

One way to implement would require to modify inherent parser used by obsidian export. We need to modify the definition of block. A block may have an id, since block is not provided tags
block_element -> block_element id
id -> "" | id -> ^number

Maybe it can be implemented as post processor, for each block event we can extract the ^block id using regex and store it and later use them while embedding.

I would love to hear if there could be simple approach without modifying the library and just use post processor to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants