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

Weird behavior on Facebook 2 #2

Open
loia5tqd001 opened this issue Aug 30, 2020 · 0 comments
Open

Weird behavior on Facebook 2 #2

loia5tqd001 opened this issue Aug 30, 2020 · 0 comments

Comments

@loia5tqd001
Copy link

Expected Behavior

Here is the screenshot of Facebook's About section without the extension: (the sentence 新增個人簡介,讓大家更瞭解你。 is on the same line)

image

Actual Behavior

Here is the screenshot after installing the extension (the sentence is broken into multiple lines undesirably):
image

Cause

I've found out the reason is that before replacing text, the element div._b5a has the flex-column styles:

<div class="_b5a" style="text-align: center; opacity: 0.7;">新增個
+<mark class="wkh-hl" style="background-color: rgb(255, 0, 0); color: inherit;">+</mark>
簡介,讓
+<mark class="wkh-hl" style="background-color: rgb(255, 0, 0); color: inherit;">+</mark>
家更瞭解你。
</div>
._b5a {
    display: flex;
    flex-direction: column;
}

Without the mark Elements, flex-column is fine, but with marks inside, the sentence will spread vertically like above.

loia5tqd001 added a commit to loia5tqd001/wanikani-highlighter that referenced this issue Aug 30, 2020
loia5tqd001 added a commit to loia5tqd001/wanikani-highlighter that referenced this issue Aug 31, 2020
- thanks to this answer: https://stackoverflow.com/a/63654691/9787887
- to make the text prominent, font-weight, font-size and color are good enough,
no need to use background-color. Moreover, this approach will help avoiding the risk
of another breaking in the future (unlike the previous approach).
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

No branches or pull requests

1 participant