Skip to content

Improvements on filtering, forbidden tags, and debugging#37

Merged
kyledaviswx merged 6 commits into
mainfrom
35-html-comments-should-be-ignored
Jul 23, 2025
Merged

Improvements on filtering, forbidden tags, and debugging#37
kyledaviswx merged 6 commits into
mainfrom
35-html-comments-should-be-ignored

Conversation

@kyledaviswx
Copy link
Copy Markdown
Collaborator

@kyledaviswx kyledaviswx commented Jul 22, 2025

  • Issue/30 - Add reject logic for elements with the translate="no" attribute
  • Issue/35 - Add the following forbiddenTags: 'i', 'iframe', 'svg', 'code', 'samp', 'var', 'noscript', 'template', 'time', 'math', 'canvas', 'data', 'output', 'meter', 'progress', 'slot'
  • Issue/35Add filter reject if html element contains the aria-hidden attribute or is a html comment
  • General - Wrap the console log of options to only show if verboseOutput is true
  • General - Run build for new index.js and map files
  • General - Update to workflows to use compatible and active versions of node.

Linked to issues:
#35
#30

…p', 'var', 'noscript', 'template', 'time', 'math', 'canvas', 'data', 'output', 'meter', 'progress', 'slot'

- Add filter reject if html element contains the aria-hidden attribute.
- Wrap the console log of options to only show if verboseOutput is true.
- Run build for new index.js and map files.
@kyledaviswx kyledaviswx added the enhancement New feature or request label Jul 22, 2025
@kyledaviswx kyledaviswx linked an issue Jul 22, 2025 that may be closed by this pull request
@kyledaviswx kyledaviswx requested a review from Copilot July 22, 2025 16:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the translation widget's filtering capabilities by expanding forbidden HTML tags, improving accessibility compliance, and adding conditional debugging output. The changes also modernize the CI/CD pipeline to use currently supported Node.js versions.

  • Expands forbidden tags list to include semantic and technical elements that shouldn't be translated
  • Adds filtering for aria-hidden elements and HTML comments to improve accessibility compliance
  • Implements conditional console logging based on verboseOutput setting

Reviewed Changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 2 comments.

File Description
src/customTreeWalker.ts Expands forbidden tags list and adds filtering for aria-hidden elements and comments
src/widget.tsx Wraps debug console output in conditional check for verboseOutput option
.github/workflows/main.yml Updates Node.js versions and GitHub Actions to currently supported versions

Comment thread src/widget.tsx
Comment thread src/customTreeWalker.ts Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@kyledaviswx kyledaviswx requested a review from ben-hamelin July 22, 2025 17:33
@kyledaviswx kyledaviswx changed the title Issue/35 - Improvements on filtering, forbidden tags, and debugging Improvements on filtering, forbidden tags, and debugging Jul 22, 2025
Copy link
Copy Markdown
Collaborator

@ben-hamelin ben-hamelin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kyledaviswx these look good! Approved

@kyledaviswx kyledaviswx merged commit 14dfb93 into main Jul 23, 2025
6 checks passed
@kyledaviswx kyledaviswx deleted the 35-html-comments-should-be-ignored branch July 23, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTML comments should be ignored

3 participants