Skip to main content

# init.py import re def safelink_zwsp(text: str) -> str: """ Insert zero-width spaces into URLs to prevent auto-linking and allow…

Project description

PyPI version License: MIT Downloads LinkedIn

zwsp_linker

zwsp_linker is a Python package designed to insert zero-width spaces into URLs within text. This is particularly useful for preventing automatic hyperlinking in markdown or other text rendering environments, while still allowing users to easily copy and paste the complete URL.

Installation

To install zwsp_linker, use pip:

pip install zwsp_linker

Usage

Using zwsp_linker is straightforward. Import the safelink_zwsp function and pass your text to it.

from zwsp_linker import safelink_zwsp

text_with_urls = "Check out this link: http://example.com and another one https://anothersite.org."
modified_text = safelink_zwsp(text_with_urls)

print(modified_text)
# Expected output (the zero-width space is invisible):
# Check out this link: http://​example.com and another one https://​anothersite.org.

How it works

The safelink_zwsp function uses regular expressions to find common URL schemes (like http:// or https://) and inserts a zero-width space character (U+200B) immediately after the scheme. This subtle modification disrupts the automatic hyperlinking behavior of many renderers without affecting the visual appearance or the ability to copy the URL.

Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

License

zwsp_linker is licensed under the MIT License.

Author

Eugene Evstafev hi@eugene.plus - LinkedIn

Repository

The project is hosted on GitHub: https://github.com/chigwell/zwsp_linker

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zwsp_linker-2025.9.1498.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zwsp_linker-2025.9.1498-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file zwsp_linker-2025.9.1498.tar.gz.

File metadata

  • Download URL: zwsp_linker-2025.9.1498.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for zwsp_linker-2025.9.1498.tar.gz
Algorithm Hash digest
SHA256 ac67eb552a8bbe9d00549f4f0b8475a65b390935472e5da24e428ebaa854cdbe
MD5 04295186537e237d00dbc0359954cb59
BLAKE2b-256 a53b39c8204ee668fc9166d8b7dce2934b5899ea099a3ffaf34ddfb1265e1611

See more details on using hashes here.

File details

Details for the file zwsp_linker-2025.9.1498-py3-none-any.whl.

File metadata

File hashes

Hashes for zwsp_linker-2025.9.1498-py3-none-any.whl
Algorithm Hash digest
SHA256 8fd479104eb180dc715aef08bf0cae5440eb5e5abda149f9b232457690ae6efc
MD5 c1df2066a19a7daf0fbebb5db013ff12
BLAKE2b-256 f159b758296433f41639190c11f2336d043bed3baa44a0b340b530994b0ff787

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page