Skip to content

Implement HTMLObfuscatorStrategy#8

Merged
dnp1204 merged 22 commits intomainfrom
doanh-fix-doc-builder
Sep 29, 2025
Merged

Implement HTMLObfuscatorStrategy#8
dnp1204 merged 22 commits intomainfrom
doanh-fix-doc-builder

Conversation

@dnp1204
Copy link
Collaborator

@dnp1204 dnp1204 commented Sep 29, 2025

This obfuscator preserves HTML tags and attributes, preserves text in elements with class "qbd-output", and obfuscates all other text using DictionaryObfuscatorStrategy

@dnp1204 dnp1204 requested a review from Copilot September 29, 2025 09:57
@dnp1204 dnp1204 self-assigned this Sep 29, 2025
Copy link

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 implements a new HTMLObfuscatorStrategy that intelligently obfuscates HTML content while preserving essential structure and specific protected elements. The strategy parses HTML, obfuscates text content and attribute values, but preserves text within elements having the "qbd-output" class and protects certain HTML attributes from obfuscation.

Key changes:

  • Introduces HTMLObfuscatorStrategy with HTML parsing capabilities and selective obfuscation
  • Adds base class architecture with BaseObfuscatorStrategy for inheritance consistency
  • Sets up Jest testing framework with comprehensive test coverage

Reviewed Changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/classes/obfuscators/HTMLObfuscatorStrategy.js Main implementation of HTML-aware obfuscation strategy
src/classes/obfuscators/BaseObfuscatorStrategy.js Base class providing common interface for all obfuscator strategies
src/classes/obfuscators/ObfuscatorStrategyMap.js Registers the new HTML obfuscator in the strategy map
src/classes/obfuscators/NoObfuscatorStrategy.js Updates to extend from BaseObfuscatorStrategy
package.json Adds node-html-parser dependency and Jest testing framework
tests/obfuscators/HTMLObfuscatorStrategy.test.js Comprehensive test suite covering all obfuscation scenarios
.github/workflows/test.yml CI workflow for automated testing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@dnp1204 dnp1204 requested a review from Copilot September 29, 2025 10:06
Copy link

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

Copilot reviewed 7 out of 9 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Collaborator

@lpires-ccs lpires-ccs left a comment

Choose a reason for hiding this comment

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

Great to see unit tests and a ci workflow. Great job.

@dnp1204 dnp1204 merged commit eb5c51f into main Sep 29, 2025
1 check passed
@rsshilli rsshilli deleted the doanh-fix-doc-builder branch September 29, 2025 13:52
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.

3 participants