Skip to content

Commit 6b2b0d1

Browse files
committed
Remove HTML tags from Ayah info dialog and Sura info dialog
1 parent 6554620 commit 6b2b0d1

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

Work in progress.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
في العرض المخصص, تعطيل الذهاب إلى وقلب الصفحات تلقائيًا. تم
1414
في العرض المخصص, تمرير أكسسبل نيم للأزرار والخيارات باسم التالي والسابق والذهاب إلى.
1515
في معلومات الآية, يجب إضافة موضع الآية ضمن الجزء.
16-
في معلومات الآية والسورة, تعطيل تنسيق HTML.
16+
في معلومات الآية والسورة, تعطيل تنسيق HTML. تم
1717
في إضافة علامة, عرض رسالة خطأ إذا تمت إضافة علامة بدون اسم. تم
1818
في العلامات, تعطيل الخيارات إذا لم يتم تحديد علامة.
1919
في اختيار كروت الصوت, ترجمة ديفولت للافتراضي وتعطيل خيار No sound.

core_functions/info.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -149,18 +149,16 @@ def format_text(result: dict) -> str:
149149
"""Format the Aya information into a readable string."""
150150
logger.debug(f"Formatting Aya information for Ayah {result['numberInSurah']}.")
151151
text = """|
152-
<ul>
153-
<li><strong>رقم الآية:</strong> {}.</li>
154-
<li><strong>رقم الآية في المصحف:</strong> {}.</li>
155-
<li><strong>السورة:</strong> {}.</li>
156-
<li><strong>رقم السورة:</strong> {}.</li>
157-
<li><strong>رقم الصفحة:</strong> {}.</li>
158-
<li><strong>رقم الجزء:</strong> {}.</li>
159-
<li><strong>رقم الحزب:</strong> {}.</li>
160-
<li><strong>رقم الربع:</strong> {}.</li>
161-
<li><strong>سجدة:</strong> {}.</li>
162-
<li><strong>سجدة واجبة:</strong> {}.</li>
163-
</ul>
152+
رقم الآية: {}.
153+
رقم الآية في المصحف: {}.
154+
السورة: {}.
155+
رقم السورة: {}.
156+
رقم الصفحة: {}.
157+
رقم الجزء: {}.
158+
رقم الحزب: {}.
159+
رقم الربع: {}.
160+
سجدة: {}.
161+
سجدة واجبة: {}.
164162
""".format(result["numberInSurah"], result["number"], result["sura_name"], result["sura_number"], result["page"], result["juz"], result["hizb"], result["hizbQuarter"], result["sajda"], result["sajdaObligation"])
165163
logger.debug(f"Aya information formatted successfully.")
166164

@@ -218,13 +216,13 @@ def _format(self, data: dict) -> str:
218216
"end_hizb_quarter": "تنتهي في الربع"
219217
}
220218

221-
text = "<ul>\n"
219+
text = "|\n"
222220
for key, label in arabic_labels.items():
223221
value = data.get(key, "غير متوفر")
224-
text += f"<li><strong>{label}:</strong> {value}.</li>\n"
222+
text += f"{label}: {value}.\n"
225223

226224
logger.debug(f"Formatted information for Surah {data.get('name', 'Unknown')}.")
227-
return text + "</ul>"
225+
return text + ""
228226

229227

230228
class JuzInfo(Base):

ui/quran_interface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ def OnAyahInfo(self, event):
445445
label = "معلومات الآية:"
446446
text = AyaInfo(current_aya.number).text
447447
logger.debug(f"Displaying information for ayah {current_aya.number_in_surah} in {current_aya.sura_name}")
448-
InfoDialog(self, title, label, text, is_html_content=True).open()
448+
InfoDialog(self, title, label, text, is_html_content=False).open()
449449

450450
@exception_handler(ui_element=QMessageBox)
451451
def OnSurahInfo(self, event):
@@ -455,7 +455,7 @@ def OnSurahInfo(self, event):
455455
label = "معلومات السورة:"
456456
sura_info = SuraInfo(current_aya.sura_number)
457457
logger.debug(f"Displaying information for surah {current_aya.sura_name}")
458-
InfoDialog(self, title, label, sura_info.text, is_html_content=True).open()
458+
InfoDialog(self, title, label, sura_info.text, is_html_content=False).open()
459459

460460
@exception_handler(ui_element=QMessageBox)
461461
def OnJuzInfo(self, event):

0 commit comments

Comments
 (0)