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

[MWPW-168691] - Aside cta shrink JP #3785

Open
wants to merge 9 commits into
base: stage
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions libs/features/japanese-word-wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ function isFirefox() {
return navigator.userAgent.includes('Firefox');
}

function isAsideCta(element) {
return element.closest('.aside') && element.parentElement?.classList.contains('con-button');
}

/**
* Check if a word wrap has been applied to an element.
*/
Expand Down Expand Up @@ -133,6 +137,7 @@ export async function applyJapaneseLineBreaks(config, options = {}) {
if (
budouxExcludeElements.has(el)
|| isWordWrapApplied(el)
|| isAsideCta(el)
|| (isFirefox() && hasFlexOrGrid(el))
) return;
parser.applyElement(el, { threshold: budouxThres });
Expand Down
Loading