← Back to team overview

mahara-contributors team mailing list archive

[Bug 1826948] Re: Comment text being saved with extra HTML tags

 

** Changed in: mahara
       Status: New => In Progress

** Changed in: mahara
   Importance: Undecided => High

** Changed in: mahara
    Milestone: None => 19.04.0

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1826948

Title:
  Comment text being saved with extra HTML tags

Status in Mahara:
  In Progress

Bug description:
  In 18.04 we made a change which meant we inadvertently started saving
  comment text like this:

  <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd";> <html><body><p>comment text</p></body></html>                                                         
              
  instead of like this:
  <p>comment text</p>

  this is because a call to loadHTML() adds the extra tags unless passed
  in flags tell it not to.

  As well as fixing this problem, we need to check that other places in
  the code that use loadHTML() are not also adding extra tags.

  Steps to reproduce:

  1. Add a comment
  2. Check the database and check what is stored in the artefact table for the text of that comment

  What you should see:
  The text of the comment you added inside <p> tags

  What you currently see:
  The text of the comment you added inside the doctype and body tags as well.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1826948/+subscriptions


References