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

Automatically convert URLs into clickable links in posts and pages #758

Closed
wants to merge 2 commits into from
Closed

Conversation

KuJoe
Copy link
Sponsor Contributor

@KuJoe KuJoe commented May 19, 2024

Properly formatted URLs are detected and converted to clickable links in posts and pages. Ignores URLs already clickable and removes </p> added to some links at the end of lines.

Tested as best I could but I'm sure there will be some cases where this will not work or cause some issues but for properly formatted links this works as expected.

Should resolve #422

Properly formatted URLs are detected and converted to clickable links in posts and pages. Ignores URLs already clickable and removes </p> added to some links at the end of lines.
@danpros
Copy link
Owner

danpros commented May 19, 2024

This feature should optional because it far more easier to create auto link compared to remove the auto link.

To create auto link we can use theme functions.php and create a custom function there. Example we use it in post.html.php

<?php echo auto_clickable($p->body);?>

@danpros
Copy link
Owner

danpros commented May 19, 2024

The theme functions.php available since version 2.9.1 so it is not yet widely used.

@KuJoe
Copy link
Sponsor Contributor Author

KuJoe commented May 19, 2024

Thank you for explaining this! I wasn't aware of the functions.php feature in themes but after doing some more research I was able to figure it out very easily.

I don't like the idea of having to change the code for the existing themes, but it works good. This PR will be closed.

@KuJoe KuJoe closed this May 19, 2024
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

Successfully merging this pull request may close these issues.

[Feature request] automatically make link in post click-able (like github/gitlab)
2 participants