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

Use HTML tag processor to strip formatted addresses of tags #46775

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

joshuatf
Copy link
Contributor

Changes proposed in this Pull Request:

Use the HTML tag processor to remove br tags from addresses instead of the regex currently used.

It's unclear whether or not other tags should be allowed in those addresses, but they're often escaped which could result in some funky formatting.

This PR strips out all tags and replaces br tags with a replacement in plain text.

Closes # .

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

Check the following to make sure that addresses are rendered correctly, including br and other HTML tags in their source.

  1. Trigger some emails that contain billing/shipping addresses
  2. Check that admin orders list table to verify address formatting
  3. Export privacy data and verify address formatting

Changelog entry

  • Automatically create a changelog entry from the details below.

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Comment

@joshuatf joshuatf self-assigned this Apr 20, 2024
@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Apr 20, 2024
Copy link
Contributor

Hi @tjcafferkey,

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

@tjcafferkey
Copy link
Contributor

tjcafferkey commented Apr 20, 2024

I think it would be beneficial for some unit tests to be written for this function. Wdyt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: woocommerce Issues related to the WooCommerce Core plugin.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants