Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-1491

Glossary potentially makes html invalid

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.3
    • Fix Version/s: None
    • Component/s: Glossary
    • Labels:
      None
    • Environment:
      All
    • Affected Branches:
      MOODLE_13_STABLE

      Description

      If I post something in HTML format, with a valid <a> element, but the link text contains a recognised glossary term, a nested <a> element is introduced for the glossary item, which makes the resulting html invalid and behaviour unpredictable.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            dougiamas Martin Dougiamas added a comment -

            From Eloy Lafuente (stronk7 at moodle.org) Saturday, 29 May 2004, 07:37 AM:

            Opps.

            teorically, the glossary filter avoids to modify text inside <a> tags. I'll test it tomorrow carefully.

            Anyway could it be possible for you to attach one txt file containing your exact resource html text and the term breaking things... To test exactly your situation...

            TIA and ciao, Eloy

            From barry mcmullin (barry.mcmullin at dcu.ie) Saturday, 29 May 2004, 04:14 PM:

            I encountered the problem when submitting a forum message (as

            HTML format):

            http://moodle.org/mod/forum/discuss.php?d=8403&parent=40271

            The glossary word causing difficulty is XHTML. I don't have the

            original HTML fragment I submitted anymore; but I have

            reconstructed it (more or less) as the attachment globug.html

            (also uploaded as globug.html.txt so it can be viewed in plain

            form easily).

            The glossary still added an extra A element around XHTML, thus

            breaking it. (I eventually worked around it by duplicating my

            own hyperlink on the words before and after XHTML, and leaving

            XHTML out of the link text...)

            Does that explain it?

            From Eloy Lafuente (stronk7 at moodle.org) Sunday, 30 May 2004, 07:54 AM:

            Thanks for your example!!!

            I think I've detected it! The reason is the newline after the begin of the link (<a). The filter seems to fail here not detecting that part of the text as a link and making substitutions inside it.

            If you edit your post/example and move the <a text to the next line it should work!!

            Anyway, I'm currently making some modifications to avoid this issue.

            Thanks again,

            From Eloy Lafuente (stronk7 at moodle.org) Sunday, 30 May 2004, 08:19 AM:

            Hi barry,

            I've done one slightly modification to the filter code and now it takes care about newlines after the <a html code.

            I've sent it to you by email.

            I've marked this issue as fixed. Please it everything is working fine, close it definitively.

            Thanks and ciao, Eloy

            This bug must be checked in resource, activitynames and wikititles too!!

            From barry mcmullin (barry.mcmullin at dcu.ie) Sunday, 30 May 2004, 04:14 PM:

            OK, I've installed the modified glossary/filter.php on a test server and verified that it corrects the problem on my test case. Changing bug status to closed.

            Heck of a job Eloy - many thanks!

            Show
            dougiamas Martin Dougiamas added a comment - From Eloy Lafuente (stronk7 at moodle.org) Saturday, 29 May 2004, 07:37 AM: Opps. teorically, the glossary filter avoids to modify text inside <a> tags. I'll test it tomorrow carefully. Anyway could it be possible for you to attach one txt file containing your exact resource html text and the term breaking things... To test exactly your situation... TIA and ciao, Eloy From barry mcmullin (barry.mcmullin at dcu.ie) Saturday, 29 May 2004, 04:14 PM: I encountered the problem when submitting a forum message (as HTML format): http://moodle.org/mod/forum/discuss.php?d=8403&parent=40271 The glossary word causing difficulty is XHTML. I don't have the original HTML fragment I submitted anymore; but I have reconstructed it (more or less) as the attachment globug.html (also uploaded as globug.html.txt so it can be viewed in plain form easily). The glossary still added an extra A element around XHTML, thus breaking it. (I eventually worked around it by duplicating my own hyperlink on the words before and after XHTML, and leaving XHTML out of the link text...) Does that explain it? From Eloy Lafuente (stronk7 at moodle.org) Sunday, 30 May 2004, 07:54 AM: Thanks for your example!!! I think I've detected it! The reason is the newline after the begin of the link (<a). The filter seems to fail here not detecting that part of the text as a link and making substitutions inside it. If you edit your post/example and move the <a text to the next line it should work!! Anyway, I'm currently making some modifications to avoid this issue. Thanks again, From Eloy Lafuente (stronk7 at moodle.org) Sunday, 30 May 2004, 08:19 AM: Hi barry, I've done one slightly modification to the filter code and now it takes care about newlines after the <a html code. I've sent it to you by email. I've marked this issue as fixed. Please it everything is working fine, close it definitively. Thanks and ciao, Eloy This bug must be checked in resource, activitynames and wikititles too!! From barry mcmullin (barry.mcmullin at dcu.ie) Sunday, 30 May 2004, 04:14 PM: OK, I've installed the modified glossary/filter.php on a test server and verified that it corrects the problem on my test case. Changing bug status to closed. Heck of a job Eloy - many thanks!
            Hide
            mblake Michael Blake added a comment -

            assign to a valid user

            Show
            mblake Michael Blake added a comment - assign to a valid user

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: