No line breaks in furigana on AnkiWeb and AnkiDroid

I use line breaks in my furigana. They are displayed correctly in my desktop version of Anki:

2024-09-13-205537_1920x1040_Anki

And they used to show up correctly in AnkiDroid, but since a few days, this stopped working in AnkiDroid and AnkiWeb:

2024-09-13-205626_1920x1040_firefox

What could cause this?

My Anki decks are synced.

See my Anki Desktop version below, AnkiDroid is also 24.06.3 2.18.4.

Anki 24.06.3 (d678e393) (src) (ao)
Python 3.12.3 Qt 5.15.14 PyQt 5.15.11
Platform: Linux-6.6.47-gentoo-x86_64-x86_64-AMD_Ryzen_7_4800H_with_Radeon_Graphics-with-glibc2.39

===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
Export in CSV format [‘1478130872’, 2024-01-07T10:08, ‘None’, ‘’]

===IDs of active AnkiWeb add-ons===
1478130872

===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])

That’s not a valid AnkiDroid version number. Can you check again?

Will you post what is in this field of the note and also your card templates, front, back, and styling? For the field, copy it from the HTML view of the field [Click < > above the field]. For both, post it as text, in a code/preformatted-text block, please.

Ah sorry. Yes, it is AnkiDroid 2.18.4.

Field:

役[やく<br>yaku]に[ni]立[た<br>ta]ちます[chimasu]

Front template:

<div id="fldExpression" class="jp">{{masu-form}}</div>
<br><br>

{{#Sample}}
<div id="fldSample" class="jp hint">{{Sample}}</div>
{{/Sample}}

<div id="fldReading" class="jp hint" style="display: none;">{{furigana:masu-reading}}</div>
<br><br>

<script language="javascript">
function setupCard() {
	var ex = document.getElementById('fldExpression');
    var rd =  document.getElementById('fldReading');

	var isSame = ex.innerText.valueOf() === rd.innerText.valueOf();
	
	if(!isSame) {
		window.setTimeout(function() {rd.style.display = 'block';},5000);
	}
}

window.setTimeout(setupCard, 1000);
</script>

Back template:

<div class=jp> {{furigana:masu-reading}} </div><br>

<hr id=answer>

masu<br>
ます<br>
Form<br>
<br>

{{#Sample}}
<div id="fldSample" class="jp hint">{{Sample}}</div>
{{/Sample}}
<br>
{{Meaning}}

Styling:

.card {
  font-family: arial;
  font-size: 20px;
  text-align: center;
  color: black;
  background-color: white;
}
.jp { font-size: 50pt }
.hint { font-size: 30pt }
.win .jp { font-family: "MS Mincho", "MS 明朝"; }
.mac .jp { font-family: "Hiragino Mincho Pro", "ヒラギノ明朝 Pro"; }
.linux .jp { font-family: "Kochi Mincho", "東風明朝"; }
.mobile .jp { font-family: "Hiragino Mincho ProN"; }

You can also find my complete deck here.

Hmm… works for me. Maybe try replacing the div tags with span style?

I’m on 2.19beta1 version. You might also want to try that version.

Where can I get this version. Currently I installed AnkiDroid from F-Droid.

I download from GitHub - ankidroid/Anki-Android: AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.

There’s a releases section if you scroll down to bottom.

Thank you. I installed it, but it makes no difference.

It works in AnkiWeb and AnkiDroid for me. Can you try changing the fonts? I’m not using your font.

I would need help with this. I copied the template and customized it to my needs. I see that the fonts are defined in the styling. But I don’t know which font families are available.
This is defining the font for my Linux desktop app?

.linux .jp { font-family: "Kochi Mincho", "東風明朝"; }

This is the font for AnkiDroid?

.mobile .jp { font-family: "Hiragino Mincho ProN"; }

What defines the font for AnkiWeb?

As the formatting works in the Linux desktop app, could I use "Kochi Mincho", "東風明朝" in AnkiDroid, too?

It is, yes.

Hmm, I really don’t know sorry.

I’d say remove it. I also don’t know whether you actually have those font files.

I removed the font-family entries:

.card {
  font-family: arial;
  font-size: 20px;
  text-align: center;
  color: black;
  background-color: white;
}
.jp { font-size: 50pt }
.hint { font-size: 30pt }

And synced whit my phone. The font on my desktop changed, the font on my phone did not (so it always used a default?). The formatting stayed the same on both devices: Working as expected in the desktop app, broken as shown above in AnkiWeb and AnkiDroid.

Btw, AnkiWeb uses the desktop font on my desktop system and the Android font on my phone.

About my phone:

Android-Version 14
LineageOS-Version 21-20240908-NIGHTLY-kiev

Maybe the view in AnkiDroid broke with the latest LineageOS Update. I can’t tell if formatting ever worked in AnkiWeb, because I did not use it (I just checked after the formatting broke in AnkiDroid).

I would like to post a link to screenshots of my AnkiDroid on Gitlab back then when it was working. But I am blocked:

An error occurred: Sorry, you can’t include links in your posts.

Maybe. Did you try updating your webview app from playstore? That not being updated causes problem at times.

Just post it in code block like you did here.

Did you try updating your webview app from playstore?

As I am using LineageOS without Google apps, I try to avoid playstore. I checked my webview version. It is 128.0.66.13.88.

And I did another check. I tested Ankiweb with Chromium (a Google-free Chrome) …et voilà:

The screenshot in my initial post was taken from Firefox. So at least now I know, that it is related to the web engine.

Chromium Version 127.0.6533.99 (Official Build) (64-bit)

So maybe formatting breaks somewhere between 127.0.6533.99 128.0.66.13.88?

@sorata What is your Chrome/Webview version?

It’s 127.0.6533.103 which is not that different from you. Can you maybe downgrade and see if that helps?

127.0.6533.x is the version which is working for me, too (on my laptop). But an my Android it is 128.0.66.13.88 which is not working.

Downgrading only Webview (Chrome) is not possible on my phone. And also this won’t be a future proof solution.

I don’t know any particular workaround but you can try reporting the issue. Maybe also check a dev version to see if that fixes it and then upgrade to that on your phone?

Reporting to AnkiWeb (I could not find the bug tracker), AnkiDroid or Chrome?