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

Suggest adding URL-encoded text variable to enable deep-linking features #37

Closed
zbh531 opened this issue Mar 25, 2022 · 1 comment
Closed

Comments

@zbh531
Copy link

zbh531 commented Mar 25, 2022

Hi! I really enjoy using this extension to copy text as Markdown to further make notes. One of the features I'd really like to have for this extension is deep-linking as in "Copy link to highlight" in the right-click menu in Chrome. Therefore, I suggest adding a URL-encoded text variable, where some special characters in selected text are encoded using URL encoding, aka percent-encoding. For example, spaces in a string are encoded with %20, and colons signs (:) encoded with %3A.

Example:

Default Markdown Format: [%text_md%](%url%)
Current result: In the United States, about 80% of household cats are neutered.
Source mode: [In the United States, about 80% of household cats are neutered\.](https://en.wikipedia.org/wiki/Cat)

Desired Markdown Format: [%text_md%](%url%#:~:text=%text_urlenc%)1
Suggested result: In the United States, about 80% of household cats are neutered.2
Source mode: [In the United States, about 80% of household cats are neutered\.](https://en.wikipedia.org/wiki/Cat#:~:text=In%20the%20United%20States%2C%20about%2080%25%20of%20household%20cats%20are%20neutered.) 3

Thank you in advance for your attention to this matter.

Footnotes

  1. The proposed %text_urlenc% variable denotes selected text that is URL-encoded.

  2. This URL would be directed to selected (highlighted) text.

  3. Spaces in selected text ( ) are encoded with %20, commas (,) with %2C, and percent signs (%) with %25.

@zbh531
Copy link
Author

zbh531 commented Apr 6, 2022

I found that adding the deep-linking feature was not as simple as I thought that adding a URL-encoded text variable would work, where another two variables (textStart & textEnd) are also necessary. However, I did figure out a workaround.

Workaround Markdown Format: [%text_md%](%input%)
Step 1: Copy selected text using "Copy link to highlight" in the right-click menu in Chrome.
Step 2: "Creat Link as Workaround Markdown" using this extension.
Step 3: Paste the copied link in Step 1 to the popup dialog.

Thanks again for all your hard work. I really love this extension!

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

No branches or pull requests

1 participant