gocodebox / lifterlms

LifterLMS, a WordPress LMS Solution: Easily create, sell, and protect engaging online courses.
https://lifterlms.com
GNU General Public License v3.0
174 stars 134 forks source link

Quill error in Course Builder with certain content #2655

Open brianhogg opened 1 month ago

brianhogg commented 1 month ago

Reproduction Steps

  1. Create a quiz on a Lesson, with certain content as a question (see HS-242192)
  2. Create another question below it by typing in some content
  3. Save changes in the course builder
  4. Refresh the page
  5. Open the quiz

Expected Behavior

All questions load and can be edited

Actual Behavior

Only the first question loads with an error in the Console

Error Messages / Logs

quill.min.js?ver=1.3.5:7 Uncaught DOMException: Failed to execute 'splitText' on 'Text': The offset 64 is larger than the Text node's length.
    at e.split (http://lifter2.test/wp-content/plugins/lifterlms/assets/vendor/quill/quill.min.js?ver=1.3.5:7:126820)
    at t.isolate (http://lifter2.test/wp-content/plugins/lifterlms/assets/vendor/quill/quill.min.js?ver=1.3.5:7:72074)
    at t.formatAt (http://lifter2.test/wp-content/plugins/lifterlms/assets/vendor/quill/quill.min.js?ver=1.3.5:7:71423)
    at http://lifter2.test/wp-content/plugins/lifterlms/assets/vendor/quill/quill.min.js?ver=1.3.5:7:49204
    at t.forEachAt (http://lifter2.test/wp-content/plugins/lifterlms/assets/vendor/quill/quill.min.js?ver=1.3.5:7:118644)
    at e.formatAt (http://lifter2.test/wp-content/plugins/lifterlms/assets/vendor/quill/quill.min.js?ver=1.3.5:7:49172)
    at e.formatAt (http://lifter2.test/wp-content/plugins/lifterlms/assets/vendor/quill/quill.min.js?ver=1.3.5:7:124028)
    at e.value (http://lifter2.test/wp-content/plugins/lifterlms/assets/vendor/quill/quill.min.js?ver=1.3.5:7:7729)
    at http://lifter2.test/wp-content/plugins/lifterlms/assets/vendor/quill/quill.min.js?ver=1.3.5:7:49204
    at t.forEachAt (http://lifter2.test/wp-content/plugins/lifterlms/assets/vendor/quill/quill.min.js?ver=1.3.5:7:118644)

This issue has be recreated: