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

Standardize text preference processing #1228

Conversation

enchanted-sword
Copy link
Contributor

Description

Standardizes all preferences using text inputs to ignore case and strip hashtags.
Currently, Hide Avatars, Show Originals, and Themed Posts do not ignore case, and Quick Reblog, Tag Replacer, Painter, and Cleanfeed ignore case and strip hashtags.

Resolves #1188 and #982

@enchanted-sword
Copy link
Contributor Author

enchanted-sword commented Aug 21, 2023

Currently, case sensitivity is standardized, but I haven't handled stripping hashtags yet. For that, I imagine an event listener will have to be added to render_scripts.js that replaces hashtag characters in the input area on input, similar to how Quick Reblog and Quick Tags replace quotes with smart quotes as mentioned in #982, something like:

...
const stripTags = ({ target }) => {
  const { value } = target.value;
  target.value = value.replace(/#/g, '');
};
...
const renderPreferences = async function ({ scriptName, preferences, preferenceList }) {
...
 switch (preference.type) {
      ...
      case 'textarea':
        ...
        preferenceInput.addEventListener('input', stripTags);
        break;
      ...
    }
...
};

@enchanted-sword enchanted-sword closed this by deleting the head repository Feb 20, 2024
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.

Standardize text preference processing across scripts
1 participant