l1xnan / obsidian-better-export-pdf

Obsidian PDF export enhancement plugin
MIT License
353 stars 22 forks source link

Export block links within a file #254

Closed ryanjamurphy closed 4 months ago

ryanjamurphy commented 4 months ago

Thanks for this plugin. Incredible work! I am supremely grateful.

One thing that doesn't work yet is block links. E.g., if I have a block:


Some text! ^myblock

And then I have a link later in the file:

A link to [[#^myblock]].

Better Export PDF doesn't export that as a link (though the text is still styled as a link).

Running Obsidian 1.6.5, Better Export PDF v. 1.8.1.

🙇‍♂️ Thanks again!

l1xnan commented 4 months ago

I tested the example you gave. The link can be jumped. Can you test to open your Debug mode and check if the blockid rendering is normal? image

ryanjamurphy commented 4 months ago

D'oh, should have tested my own demo. The actual problem I'm having is a block id for a callout, which perhaps is already covered by https://github.com/l1xnan/obsidian-better-export-pdf/issues/100#issuecomment-1916706283

blockid in the target seems to render properly in the DOM, but the link does not:

CleanShot 2024-07-09 at 12 50 56

CleanShot 2024-07-09 at 12 50 17

Here's what's failing for me. The target:


> [!OUTCOME]+ Use principles and frameworks to make ethical decisions about information systems and knowledge management issues in organizations.
> 
> - [ ] 📖 Read the introduction and chapter 1 of Mike Monteiro's _Ruined by Design_ %% [@Monteiro2019Ruined-By-Design-How-Designers, introduction and chapter 1] %%
> - [ ] 📖 Review the Canadian guidelines to security and privacy of information
> - [ ] 📖 Review the ethical lenses reading
> - [ ] 📚 [[#Topic exams]]
> - [ ] ✍️ [[#Applied reflections]]: [[#Ethical Information Systems]]
^MGMT-6006-LO-5-1

...and the link:

#### Ethical Information Systems

> [!OUTCOME] Week 11
> - [ ] [[#^MGMT-6006-LO-5-1]]

Review and respond to the chosen case study.
What are the ethical dilemmas in the case?
What should the organization do? Why?

Perhaps it is case-sensitive?

ryanjamurphy commented 4 months ago

Aha. Yes.

I just switched both the link and the target ID to all-lowercase and it started working. 😀

l1xnan commented 4 months ago

I haven't seen a situation where the blockid is in uppercase. Obsidian should have made the conversion, but I didn't convert it, which caused this problem. It will be fixed in the next version. For now, we can only uniformly use lowercase to solve this issue.

ryanjamurphy commented 4 months ago

I haven't seen a situation where the blockid is in uppercase. Obsidian should have made the conversion, but I didn't convert it, which caused this problem. It will be fixed in the next version. For now, we can only uniformly use lowercase to solve this issue.

I am not surprised. I often add block IDs manually, sometimes with a custom syntax, so that I can use them later without needing to search. In this case, I'm designing a course, and have added ^MGMT-6006-LO-1-1 to every learning outcome: MGMT-6006 is the course identifier, LO stands for Learning Outcome, and 1-1 means "module 1, learning outcome 1."

And yes, I'll swap my block IDs to lowercase here. Thanks for the solve in the future update!