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

Fix issue 42 #43

Merged
merged 5 commits into from
Aug 25, 2023
Merged

Fix issue 42 #43

merged 5 commits into from
Aug 25, 2023

Conversation

RyotaUshio
Copy link
Collaborator

@RyotaUshio RyotaUshio commented Aug 25, 2023

#42

Added some logging code for debugging.

@RyotaUshio
Copy link
Collaborator Author

Maybe it's fixed. Let me know if this change causes another issue.

Reading view

image

Live preview

image

@RyotaUshio RyotaUshio changed the title Fix issue #42 Fix issue 42 Aug 25, 2023
@zhaoshenzhai
Copy link
Owner

zhaoshenzhai commented Aug 25, 2023

I made a minor change to account for links like [Main](Main.md) where Main.md has mathLink: $\alpha$, but kept the rest unchanged.

Scrot_2023_08_25_113814

Left: live-preview. Right: reading.

@zhaoshenzhai zhaoshenzhai self-assigned this Aug 25, 2023
@zhaoshenzhai zhaoshenzhai added the bug Something isn't working label Aug 25, 2023
@RyotaUshio
Copy link
Collaborator Author

Do you mean the link on the left side should be rendered as $\mathcal{N}$ ote? I've pulled your latest commit but it doesn't work...

image

@zhaoshenzhai
Copy link
Owner

zhaoshenzhai commented Aug 25, 2023

In your example, I think [note](note.md) should render as $\mathcal{N}$ ote, while [foo](note.md) should render as just foo.

@RyotaUshio
Copy link
Collaborator Author

Oh I see, then it perfectly works!

@zhaoshenzhai
Copy link
Owner

Perfect, Ill merge this PR now!

@zhaoshenzhai zhaoshenzhai merged commit 7f4c8e7 into zhaoshenzhai:master Aug 25, 2023
@RyotaUshio
Copy link
Collaborator Author

@zhaoshenzhai A minor point, but this line needs to be optional chaining ?. since targetEl.getAttribute("data-href") might be null.

const targetLink = targetEl.getAttribute("data-href").replace(/\.md/, "");

that is

targetEl.getAttribute("data-href")?.replace(/\.md/, ""); 

@zhaoshenzhai
Copy link
Owner

Right, yes, thank you!

@RyotaUshio RyotaUshio deleted the fix-issue42 branch August 25, 2023 17:59
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

Successfully merging this pull request may close these issues.

2 participants