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

rocket_lrc_processed_tags should be case insensitive #6948

Closed
MathieuLamiot opened this issue Sep 5, 2024 · 1 comment · Fixed by #6949
Closed

rocket_lrc_processed_tags should be case insensitive #6948

MathieuLamiot opened this issue Sep 5, 2024 · 1 comment · Fixed by #6949
Assignees
Labels
effort: [XS] < 1 day of estimated development time
Milestone

Comments

@MathieuLamiot
Copy link
Contributor

MathieuLamiot commented Sep 5, 2024

Context

As reported by the support team while testing, elements passed to the filter rocket_lrc_processed_tags (renaming ongoing, could still be named rocket_lazy_render_content_processed_tags) must be added as uppercase currently.
On OCI feature, we are agnostic of upper/lower case so we should align.

The root cause and possible fix are already discussed here: https://wp-media.slack.com/archives/C07LKLTKBG8/p1725516717052949

Expected behavior

Elements added to the processed_tags must be handled correctly whether they are added to the filtered array as lower or upper case.

Acceptance criteria

On a page with a h1 element that should get the LRC hash (depth being properly configured):

  • When using the following snippet, the hash is added to the h1 element:
add_filter( 'rocket_lazy_render_content_processed_tags', function( $tags ){
	$tags[]= "H2";
	$tags[]= "H1";
    return $tags;
} )
  • When using the following snippet, the hash is added to the h1 element:
add_filter( 'rocket_lazy_render_content_processed_tags', function( $tags ){
	$tags[]= "h2";
	$tags[]= "h1";
    return $tags;
} )
@MathieuLamiot
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: [XS] < 1 day of estimated development time
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants