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

fix: Support Flexible Parsing #37

Merged
merged 1 commit into from
Jul 23, 2024
Merged

fix: Support Flexible Parsing #37

merged 1 commit into from
Jul 23, 2024

Conversation

FentPams
Copy link
Contributor

@FentPams FentPams commented Jul 23, 2024

Description

When the format Audience: mobile or Campaign: c1 appears in page metadata
Screenshot 2024-07-22 at 12 24 01 PM

The space after the colon will be read as hypen, for example:
Screenshot 2024-07-22 at 12 27 18 PM

which could possibly cause potential issue when we extracting the value by applying the substring based on the string length:

const key = meta.getAttribute('name')
      ? meta.getAttribute('name').substring(scope.length + 1)
      : meta.getAttribute('property').substring(scope.length + 2);

To make it more robust on taking either Audience:mobile, or Audience: mobile, or even more crazy Audience: mobile. the function for handling the hyphen is introduced. The key we take from the properties will be handled by removing all leading hypen.

After handling hyphens:

Screenshot 2024-07-23 at 9 27 03 AM Screenshot 2024-07-23 at 9 27 14 AM Screenshot 2024-07-23 at 9 27 28 AM

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link

codecov bot commented Jul 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (v2@f29dd80). Learn more about missing BASE report.

Additional details and impacted files
@@          Coverage Diff          @@
##             v2      #37   +/-   ##
=====================================
  Coverage      ?   94.09%           
=====================================
  Files         ?        1           
  Lines         ?      677           
  Branches      ?       11           
=====================================
  Hits          ?      637           
  Misses        ?       29           
  Partials      ?       11           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@FentPams FentPams requested a review from ramboz July 23, 2024 16:31
@FentPams FentPams marked this pull request as ready for review July 23, 2024 16:40
@ramboz ramboz merged commit f7c45aa into v2 Jul 23, 2024
5 checks passed
@ramboz ramboz deleted the flexible-parsing branch July 23, 2024 17:17
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.

2 participants