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

BUG: fragment_link doesn't URL-escape text-fragments correctly #304

Open
stochastical opened this issue Jan 3, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@stochastical
Copy link
Contributor

Version (please complete the following information):

  • OS: iOS
  • Browser: Safari
  • Web Clipper version: 0.10.5
  • Obsidian version: 1.7.7

Describe the bug

On this website: https://en.m.wikipedia.org/wiki/Mel-frequency_cepstrum highlight the following paragraph

There can be variations on this process, for example: differences in the shape or spacing of the windows used to map the scale,[4] or addition of dynamics features such as "delta" and "delta-delta" (first- and second-order frame-to-frame difference) coefficients.

and apply this Template:

{{highlights|map:item => item.text|fragment_link|list}}

The resulting Markdown in Obsidian looks as follows (I've manually added newlines here for error readability)

There can be variations on this process, for example: differences in the shape or spacing of the windows used to map the scale,
or addition of dynamics features such as "delta" and "delta-delta" (first- and second-order frame-to-frame difference) coefficients.
[link](https://en.m.wikipedia.org/wiki/Mel-frequency_cepstrum#:~:text=There%20can%20be%20variations%20on,and%20second-order%20frame-to-frame%20difference)%20coefficients.)

The fragment_link filter did not URL-escape the closing parenthesis in the text fragment

"...second-order frame-to-frame difference)"

Hence, the Markdown URL is https://en.m.wikipedia.org/wiki/Mel-frequency_cepstrum#:~:text=There%20can%20be%20variations%20on,and%20second-order%20frame-to-frame%20difference with trailing %20coefficients.) rendered as plaintext, outside of the URL.

Expected behavior

The rendered URL should look like (using full text highlighting too, not "skipping" content as the fragment_link filter currently does):

https://en.m.wikipedia.org/wiki/Mel-frequency_cepstrum#:~:text=There%20can%20be%20variations%20on%20this%20process%2C%20for%20example:%20differences%20in%20the%20shape%20or%20spacing%20of%20the%20windows%20used%20to%20map%20the%20scale%2C[4]%20or%20addition%20of%20dynamics%20features%20such%20as%20%22delta%22%20and%20%22delta%2Ddelta%22%20(first%2D%20and%20second%2Dorder%20frame%2Dto%2Dframe%20difference)%20coefficients.

This renders nicely as a Markdown link as:

link

@stochastical stochastical added the bug Something isn't working label Jan 3, 2025
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

1 participant