This commit is contained in:
恍兮惚兮 2024-05-18 02:09:23 +08:00
parent 7ad0956e6e
commit 8c62a3cb4b
4 changed files with 17 additions and 6 deletions

View File

@ -251,7 +251,12 @@ class AnkiWindow(QWidget):
def loadfileds(self):
word = self.currentword
explain = json.dumps(gobject.baseobject.searchwordW.generate_explains())
explain = json.dumps(
json.dumps(
gobject.baseobject.searchwordW.generate_explains(), ensure_ascii=False
),
ensure_ascii=False,
)
remarks = self.remarks.toHtml()
example = self.example.toPlainText()
ruby = self.ruby
@ -531,7 +536,13 @@ class AnkiWindow(QWidget):
def reset(self, text):
self.currentword = text
if text and len(text):
self.ruby = json.dumps(gobject.baseobject.translation_ui.parsehira(text))
self.ruby = json.dumps(
json.dumps(
gobject.baseobject.translation_ui.parsehira(text),
ensure_ascii=False,
),
ensure_ascii=False,
)
else:
self.ruby = ""
self.editpath.clear()

View File

@ -8,7 +8,7 @@
</div>
<script>
ruby = {{ rubytext }}
ruby = JSON.parse({{ rubytext }})
html = ''
if (ruby.length) {
for (i = 0; i < ruby.length; i++) {
@ -56,7 +56,7 @@
</div>
<script>
explains = {{ explain }}
explains = JSON.parse({{ explain }})
function safehtml(html) {
var tempParent = document.createElement('div');

View File

@ -8,7 +8,7 @@
</div>
<script>
ruby = {{ rubytext }}
ruby = JSON.parse({{ rubytext }})
html = ''
if (ruby.length) {
for (i = 0; i < ruby.length; i++) {

View File

@ -180,7 +180,7 @@
"ankiconnect": {
"port": 8765,
"DeckName": "lunadeck",
"ModelName2": "lunamodel2",
"ModelName3": "lunamodel3",
"allowDuplicate": true,
"autoUpdateModel": true,
"ocrcroped": false