This commit is contained in:
恍兮惚兮 2024-05-16 14:14:44 +08:00
parent 52f12422b0
commit 8a4b868099
3 changed files with 23 additions and 7 deletions

View File

@ -193,7 +193,7 @@ class AnkiWindow(QWidget):
example = self.example.toPlainText()
ruby = self.ruby
fields = {
"word": word,
"word": json.dumps(word),
"rubytext": ruby,
"explain": explain,
"example_sentence": example,

View File

@ -8,11 +8,19 @@
<script>
ruby = {{ rubytext }}
word = {{ word }}
html = ''
if (ruby.length) {
for (i = 0; i < ruby.length; i++) {
html += ruby[i]['orig'] + '<rt>' + ruby[i]['hira'] + '</rt>';
}
document.getElementById('rubyword').innerHTML = '<ruby>' + html + '</ruby>'
html = '<ruby>' + html + '</ruby>'
}
else {
html = word
}
document.getElementById('rubyword').innerHTML = html
</script>

View File

@ -8,11 +8,19 @@
<script>
ruby = {{ rubytext }}
word = {{ word }}
html = ''
if (ruby.length) {
for (i = 0; i < ruby.length; i++) {
html += ruby[i]['orig'] + '<rt>' + ruby[i]['hira'] + '</rt>';
}
document.getElementById('rubyword').innerHTML = '<ruby>' + html + '</ruby>'
html = '<ruby>' + html + '</ruby>'
}
else {
html = word
}
document.getElementById('rubyword').innerHTML = html
</script>