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 copy code text twice #486

Merged
merged 1 commit into from Jan 29, 2024
Merged

Conversation

renintw
Copy link
Contributor

@renintw renintw commented Jan 25, 2024

Fixes #485

The issue arises because users add an extra <code> tag before the [php] shortcode in their generated content, resulting in an additional layer of <code> tags. This causes find( 'code' ) to select two elements, leading to the text being copied twice. first() is added here to fix the problem.
image

How to test

  1. See if it only copies once on themes/template-files-section/page-template-files/. (Two layers of <code> tag)
  2. Also check the source on the reference page as well reference/functions/is_admin/. (One layers of <code> tag)

@renintw renintw self-assigned this Jan 25, 2024
@renintw renintw added [Type] Bug Something isn't working Redesign labels Jan 25, 2024
@renintw renintw added this to the Iteration 1 milestone Jan 25, 2024
Copy link
Contributor

@adamwoodnz adamwoodnz left a comment

Choose a reason for hiding this comment

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

LGTM, nice work! 🚀

@renintw renintw merged commit 864b060 into trunk Jan 29, 2024
1 check passed
@renintw renintw deleted the fix/Copy-code-action-copies-twice branch January 29, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Redesign [Type] Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copy code action copies twice
2 participants