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

Add support for nested bold hostname in popup string #64

Merged
merged 2 commits into from
Sep 23, 2024

Conversation

lesleyjanenorton
Copy link
Member

@lesleyjanenorton lesleyjanenorton commented Sep 20, 2024

Adds support for nested bold hostname in popup string.

Screenshot 2024-09-20 at 7 04 53 PM

const el = document.createElement("p");

// Replace "dummyString" with <span>origin</span>
const parts = localizedString.split(originPlaceholder);
Copy link
Collaborator

@strseb strseb Sep 23, 2024

Choose a reason for hiding this comment

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

This will create a new node on every render()
Using a lit template result will simply cause lit to update the text of the span :)
Maybe consider:

    const parts = localizedString.split(originPlaceholder);
      return html`
          <p>
          ${parts.at(0)}
          <span class="bold">${origin}</span>
          ${parts.at(-1)}
         </p>
        `    

Copy link
Member Author

Choose a reason for hiding this comment

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

done!

@lesleyjanenorton lesleyjanenorton merged commit 278c24c into main Sep 23, 2024
5 checks passed
@lesleyjanenorton lesleyjanenorton deleted the bold-hostname-in-string branch September 23, 2024 15:25
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