Skip to content

Optional link wrapping#40

Open
gusrub wants to merge 2 commits intosoundasleep:masterfrom
gusrub:gusrub/optional-link-wrapping
Open

Optional link wrapping#40
gusrub wants to merge 2 commits intosoundasleep:masterfrom
gusrub:gusrub/optional-link-wrapping

Conversation

@gusrub
Copy link

@gusrub gusrub commented Feb 24, 2026

Hi!

I'm not sure if you accept patches but I came across a specific need to have the links not wrapped and did some changes to the code.

Basically the gem turns links like this:

<a href="https://example.com">This is a link!</a>

Into this:

[This is a link!](https://example.com)

We need to have a fully text-only version of certain html that we add for descriptions for calendar ICS integration and the markdown-like syntax kinda seems broken/off into said descriptions.

I added an optional wrap_links argument that defaults to true so the existing implementation does not break for anyone but if you pass false to the initializer or the convert method then you would get something like this instead:

This is a link!: https://example.com

Which suits or needs and probably others.

Also updated the SPEC's to include a test case for this.

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.

1 participant