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

Incorrect permalinks #189

Open
medienbaecker opened this issue Mar 7, 2024 · 2 comments
Open

Incorrect permalinks #189

medienbaecker opened this issue Mar 7, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@medienbaecker
Copy link
Contributor

The markdown field inserts permalinks in a different structure compared to the textarea field:

CleanShot 2024-03-07 at 09 19 28@2x

This is a problem in the frontend, where page links are not correct:

CleanShot 2024-03-07 at 09 24 26@2x

It also does not help to run permalinksToUrls() on the field.

@fabianmichael fabianmichael self-assigned this Mar 11, 2024
@fabianmichael fabianmichael added the bug Something isn't working label Mar 11, 2024
@medienbaecker
Copy link
Contributor Author

FYI: because this issue is quite the big deal in a current project I've fixed it like this for now:

src/components/Buttons/Link.js

submit: (values) => {
	this.input.$panel.dialog.close();
	delete values.title;
	values.text = values.text || contents || null;
+       values.href = values.href.replace('/@/page/', 'page://');
	this.insertLink(values);
}

Of course a better solution would be to reuse the textarea dialog but I generally have no idea what I'm doing.

@medienbaecker
Copy link
Contributor Author

After some time studying Kirby's code I think I know now why/how textarea and writer insert different links:

Maybe this helps someone in understanding the problem at hand. Or future-me at least.

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