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

Added the logic for Japannese search pages for description limiting t… #540

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

meejain
Copy link

@meejain meejain commented Dec 12, 2023

…o 1 line

Please always provide the GitHub issue(s) your PR is for, as well as test URLs where your change can be observed (before and after), along with a short summary of changes:

#537

Fixes #537

Changelog:

Please enter each change as a new bullet point

Test URLs:

Library

  • New Blocks introduced in this PR
    If yes, please provide details below
    Block Name : For e.g. cards

  • Documented in sidekick library

  • New variations introduced in this PR
    Variation Name : For e.g. cards (grid)

  • Documented in sidekick library

  • New mixins introduced in this PR
    Mixin Name : For e.g. compact, white

  • Documented in sidekick library

@meejain meejain requested a review from sdmcraft December 12, 2023 20:30
@meejain meejain self-assigned this Dec 12, 2023
Copy link

aem-code-sync bot commented Dec 12, 2023

Hello, I'm the AEM Code Sync Bot and I will run some test suites that validate the page speed.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-run PSI Checks

Copy link

aem-code-sync bot commented Dec 12, 2023

Page Scores Audits Google
/jp/search?s=%E5%BE%93%E4%BA%8B%E8%80%85 PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@@ -132,7 +132,9 @@ async function searchPages(placeholders, term, page) {
header.appendChild(link);
res.appendChild(header);
const para = document.createElement('p');
setResultValue(para, line.description, term);
if (getLanguage() === 'jp') {

Choose a reason for hiding this comment

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

LGTM if @ehrro is fine with this logic.

@ehrro
Copy link

ehrro commented Dec 13, 2023

Hello it looks good to me. Thanks.

setResultValue(para, line.description, term);
if (getLanguage() === 'jp') {
setResultValue(para, line.description.split('。')[0], term);
} else setResultValue(para, line.description, term);

Choose a reason for hiding this comment

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

Why just jp ? Can't the same problem happen in any language with long description?

Copy link

Choose a reason for hiding this comment

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

Only jp has so there should be another if for the other languages that use .

Copy link

Choose a reason for hiding this comment

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

Also maybe add ja as well to be safe, I don't think we have them mixed anywhere but better safe than sorry

Choose a reason for hiding this comment

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

I mean what if the line.description. is long enough to require trimming.

@meejain meejain merged commit 8b1936d into main Dec 13, 2023
2 of 4 checks passed
@meejain meejain deleted the issue537-search-jp-pages branch December 13, 2023 09:27
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.

Japanese search > search excerpt/snippet too long
5 participants