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

Copy to clipboard issues #39

Open
hiss-remi opened this issue Jan 18, 2022 · 1 comment
Open

Copy to clipboard issues #39

hiss-remi opened this issue Jan 18, 2022 · 1 comment
Labels
bug Something isn't working enhancement New feature or request

Comments

@hiss-remi
Copy link

Trusfrated brought up issues with non-textual code being copied to the clipboard here.

Upon investigation, the problem was pretty obvious. GuideMe strips out any html tags in the page text, but it doesn't remove their contents, which isn't the correct behavior for some non-displayed tags like <script> and <style>. I'm not sure if there are any other tags that should be stripped out as well or not.

Beyond that, I think it'd be useful for a tease to be able to indicate that only certain content should be copied to the clipboard; this would for instance make it possible for PlayfulGuy's downloader to more accurately emulate EOS behavior involving changed say actions without having TTS repeat everything on a page after each action.

My suggestion for this would be to use something like

<span class='TTS'>This text will be copied to the clipboard.</span>And this text won't.

With the code only copying marked spans if any of them are present, and otherwise copying everything as it currently does. That way no existing content should change unexpectedly, and selecting by inclusion is probably going to be more reliable. It shouldn't conflict with the variable interpolation of since that regular expression would not catch a span with attributes. But there may be a better way that I'm not aware of.

@EroticDevelopment EroticDevelopment added bug Something isn't working enhancement New feature or request labels Feb 6, 2022
@EroticDevelopment
Copy link
Owner

TTS definitely needs some work. I'm tagging this as both a bug (for reading JS and CSS), and an enhancement for adding more granular control over what it reads.

I like the idea of a class="TTS", but I'm curious how we would handle backwards compatibility. If we limit the TTS reader to only HTML entities with that class, we would essentially disable TTS for any existing teases before this was implemented.

I think it's reasonable to completely remove <style> and <script> nodes and their contents for TTS. That seems like an easy-ish resolution to the bug portion of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants