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

Markdown links for headings/blocks have problem #47

Open
RyotaUshio opened this issue Sep 13, 2023 · 1 comment
Open

Markdown links for headings/blocks have problem #47

RyotaUshio opened this issue Sep 13, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@RyotaUshio
Copy link
Collaborator

RyotaUshio commented Sep 13, 2023

As shown in the image below (this is the sandbox vault), MathLinks has some issues when dealing with a markdown link []() for a heading or a block.
Note that the markdown links are inserted by the built-in suggestion (the one triggered when typing [[) after turning OFF Use [[WIkilinks]].

Heading

In live preview, the MD link to the heading is not properly rendered because Obsidian replaces \ with whitespace.

Block

  1. By default, the display text is empty for block reference, like [](#^92f67b). So mathLink is not rendered.
  2. A possible solution to this problem would be setting #^blockID as the display text, i.e. [#^92f67b](#^92f67b). But this works only in live preview.

<- Live preview | Reading view ->

image

source:

---
mathLink: $\mathcal{N}$ote!
mathLink-blocks:
  "92f67b": $\mathbb{BLOCK}$
---

# $\hbar$eading


> block

^92f67b

# Wikilinks work perfectly

- `[[MathLinks test]]`: [[MathLinks test]]
- `[[#$ hbar$eading]]`: [[#$ hbar$eading]]
- `[[#^92f67b]]`:  [[#^92f67b]]

# Markdown link doesn't for headings/blocks

- `[MathLinks test](MathLinks%20test.md)`: [MathLinks test](MathLinks%20test.md)
- `[$ hbar$eading](#$%20hbar$eading)`: [$ hbar$eading](#$%20hbar$eading)
	- Probably this happens because Obsidian replaces the backslash `\` with whitespace.
	- It works after manually fixing this: `[$\hbar$eading](#$%20hbar$eading)`: [$\hbar$eading](#$%20hbar$eading)
- `[](#^92f67b)`: [](#^92f67b)
- Workaround? `[#^92f67b](#^92f67b)`: [#^92f67b](#^92f67b)
	- This works in live preview, but not in reading view
	- Essentially the same applies to the wikilink counterpart `[[#^92f67b|#^92f67b]]`: [[#^92f67b|#^92f67b]]

debug info:

SYSTEM INFO:
	Obsidian version: v1.4.11
	Installer version: v1.3.5
	Operating system: Darwin Kernel Version 22.3.0: Thu Jan  5 20:53:49 PST 2023; root:xnu-8792.81.2~2/RELEASE_X86_64 22.3.0
	Login status: not logged in
	Insider build toggle: off
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 1
	Plugins enabled: 1
		1: MathLinks v0.4.5

RECOMMENDATIONS:
	Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.
@RyotaUshio
Copy link
Collaborator Author

RyotaUshio commented Sep 13, 2023

To be honest, I'm not sure to what extent we should support markdown links.

I don't see any point in using markdown links in Obsidian (except for external links) in my opinion.
They always force us to set the displayed text manually, and the displayed text is hard to auto-update when the note title changes.
If we need markdown links for compatibility with other applications, we can simply convert wikilinks into markdown links.

It might be an option to focus on wikilinks and admit some features don't perfectly work for markdown links.

@zhaoshenzhai zhaoshenzhai self-assigned this Sep 13, 2023
@zhaoshenzhai zhaoshenzhai added the bug Something isn't working label Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants