feat: text editor for lesson body

This commit is contained in:
Jannat Patel
2023-04-05 14:13:18 +05:30
parent 67dc6d1f29
commit fafd132768
4 changed files with 17 additions and 3 deletions

View File

@@ -0,0 +1,12 @@
import frappe
from lms.lms.md import markdown_to_html
def execute():
lessons = frappe.get_all("Course Lesson", fields=["name", "body"])
for lesson in lessons:
html = markdown_to_html(lesson.body)
frappe.db.set_value("Course Lesson", lesson.name, "body", html)
frappe.reload_doc("lms", "doctype", "course_lesson")