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

Allow HTML formatted text within Lightbox captions #1566

Merged
merged 2 commits into from
Jul 13, 2020

Conversation

jchwenger
Copy link
Contributor

@jchwenger jchwenger commented Jul 13, 2020

Description

Only extracts plain text and converts html code (e.g. &) into text before injecting it into lightbox captions.

Types of changes

Only textContent instead of rawHTML here.

However, that means that no html code can be used in said captions, e.g. bold, italics. I have been looking for a way to achieve that, maybe that could be implemented in the future.

How has this been tested?

Implemented it on the website I'm currently working on.

Checklist:

  • [x ] My code is tested

Closes #1558

@richtabor richtabor added [Status] Needs Review Tracking pull requests that need another set of eyes First-time Contributor Pull request opened by a first-time contributor labels Jul 13, 2020
@richtabor richtabor added this to the Next Release milestone Jul 13, 2020
@AnthonyLedesma
Copy link
Member

AnthonyLedesma commented Jul 13, 2020

Awesome work here @jchwenger. Your changes uncovered a superior method of implementing this fix. I made a minor tweak to the JavaScript and location of change which allows users to keep the formatted text within the lightbox.

image
image

I've also taken the liberty to add your GitHub username to the CONTRIBUTORS.md file for CoBlocks. I was not able to locate a WordPress.org username for you to add to the document so let us know or submit a PR for that change if you would like.

Thank you for taking time to help make CoBlocks awesome!

Copy link
Member

@AnthonyLedesma AnthonyLedesma left a comment

Choose a reason for hiding this comment

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

I've made minor changes in your PR so as to retain HTML formatting within the Lightbox captions. Approved for merge.

@AnthonyLedesma AnthonyLedesma added the [Type] Bug Something that is not working as expected label Jul 13, 2020
@AnthonyLedesma AnthonyLedesma changed the title Ensuring no raw html in lightbox captions Allow HTML formatted text within Lightbox captions Jul 13, 2020
@AnthonyLedesma AnthonyLedesma merged commit b0a1d69 into godaddy-wordpress:master Jul 13, 2020
@jchwenger
Copy link
Contributor Author

Grand, I thought something of that kind could be done, and tried something close which didn't work, during my tests. Indeed no real WP.org account at this point... Pleasure in any case, looking forward to the next release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor [Status] Needs Review Tracking pull requests that need another set of eyes [Type] Bug Something that is not working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lightbox does not render & properly
3 participants