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

hotkey to select and copy #22

Open
Zedroid opened this issue Mar 1, 2024 · 3 comments
Open

hotkey to select and copy #22

Zedroid opened this issue Mar 1, 2024 · 3 comments

Comments

@Zedroid
Copy link

Zedroid commented Mar 1, 2024

could you please add keyboard shortcuts to let me copy the text paragrph down from anchor point? i use a tts screen reader through my clipboard

@brettz9
Copy link
Owner

brettz9 commented Mar 4, 2024

My health and energy are not great, so will have to see how I'm feeling as to whether I can get to this.

@Zedroid
Copy link
Author

Zedroid commented Mar 4, 2024

It's ok. I'm sorry to hear. Take care. Get well soon.

@brettz9
Copy link
Owner

brettz9 commented Jun 7, 2024

I'm finding it tricky to pinpoint an effective algorithm for different cases...

For example, given Wikipedia's structure:

<h2><span id="Some_heading">Some heading</span></h2>
<p>Some paragraph of text...</p>

...by clicking into the paragraph, we might:

  1. Look for an anchor, but since the paragraph is not an anchor, we look at the element above the paragraph, and since it too is not an anchor, we look for the deepest child, and since it is an anchor, return this element (and if it weren't, keep looking up the chain for ancestor nodes).
  2. Just grab the parent node of the paragraph text selection and get the paragraph text

No. 1 is what we do now, but it is a problematic in this case, as we don't want the anchor.
No. 2 works but it doesn't work well with structures like:

<a name="par1"></a>
Some <u>underlined</u> text here...
<a name="par2"></a>
Some more text...

...as clicking somewhere on "text here..." will just get "text here..." (and grabbing the parent node of "text here..." is not ideal as it will grab the text of all paragraphs).

Perhaps the algorithm should look only between but not including the nearest previous and nearest following anchor (unless the clicked area is itself an anchor, in which case, just grab the contents, e.g., if one clicked on the heading above). This might be difficult to define precisely, however...

brettz9 added a commit that referenced this issue Jun 7, 2024
feat: copy from anchor
brettz9 added a commit that referenced this issue Jun 7, 2024
feat: copy from anchor
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

2 participants