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

CSS for self-paced reading 'underlines' differs in effect on chrome and firefox #68

Open
n-kall opened this issue Sep 26, 2019 · 1 comment

Comments

@n-kall
Copy link

n-kall commented Sep 26, 2019

In the speaker-knowledge experiment (https://github.com/magpie-ea/magpie-speaker-knowledge) the 'target' sentences need to be on a new line. I accomplished this by adding <br/> in the corresponding places in the trial data:
e.g.

sentence: `This | is | the | first | example | paragraph.<br/> | You | will | see | two | more | examples | for | practice.`

Then customising the CSS like so, in order to actually show the new lines:

.magpie-spr-sentence .spr-word {
    display: inline;
}

This solution work for Firefox, but not for Chrome.

In Chrome, the word that 'includes' the break does not get underlined.

Firefox:
image

Chromium:
image

@JannisBush
Copy link
Contributor

JannisBush commented Sep 29, 2019

Confirmed the "bug" and it is even worse. When chrome adds an automatic line break because of limited space, then the last word (for in the following example) does not get underlined either.

image

The reason seems to be that chrome binds the new line character (<br>) to the start of the newline whereas firefox binds the new line character to the end of the old line. (The underline thus has a length of 0 in chrome)

We can probably add a special symbol in the input ( e.g. | #br# |) and change the spr view to parse it into a line break to fix the first problem. To fix the second issue we probably would have to rethink the complete underlining process and do not use the ::after property.

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

2 participants