support pitch number inside pitch html

This commit is contained in:
Ren Tatsumoto 2023-03-07 11:14:31 +03:00
parent 2b060a5c93
commit 80a1af77e4
4 changed files with 14 additions and 2 deletions

View file

@ -67,12 +67,16 @@
const has_no_data = (tag) => tag.innerText.toLowerCase().includes("no pitch accent");
const pitch_num = document.getElementById("pitchnum");
const pitch_pattern = document.getElementById("pitchpattern");
const pitch_num_inside_html = document.querySelector(".pitch_number");
if (pitch_num && has_no_data(pitch_num)) {
pitch_num.remove();
}
if (pitch_pattern && has_no_data(pitch_pattern)) {
pitch_pattern.innerHTML = `{{text:kana:VocabFurigana}}`;
}
if (pitch_num && pitch_num_inside_html) {
pitch_num.remove();
}
}
markPitch();

View file

@ -210,6 +210,7 @@ div.ensentence>a.hint:hover {
/* Tags */
.pitch_number,
.tags {
font-family:
"Noto Sans",
@ -346,6 +347,7 @@ footer>a:not(:last-child)::after {
display: none;
}
.vocab .pitch_number,
.vocab .tags {
align-self: flex-start;
vertical-align: top;

View file

@ -241,6 +241,7 @@ footer>a:last-child:after {
width: 0;
}
.pitch_number,
.tags {
font-family:
"Noto Sans",
@ -264,6 +265,11 @@ footer>a:last-child:after {
line-height: 14px;
}
.pitch_number {
align-self: flex-start;
vertical-align: top;
}
/*
AnkiDroid peplay button
.replaybutton is an <a> tag with a <span> that has an <svg> inside