Last modified: 2010-05-15 15:59:45 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T14628, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 12628 - Excess </dd> tags are generated
Excess </dd> tags are generated
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
Page editing (Other open bugs)
1.11.x
All All
: High normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-14 17:48 UTC by Hari Dara
Modified: 2010-05-15 15:59 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Hari Dara 2008-01-14 17:48:54 UTC
I am using colon (:) to prefix the list items such that I will get an extra indentation (I don't like <blockquote> as it gives too much indentation). This seems to rather work very well, but I consistently see extra </dd> getting generated and no matter how I try to remove them, they come back when I save (even if they don't exist in the preview). Here is an example (wikitext):

>>>>
Here are some fruits:
:* apples
:* bananas
:* oranges
<<<<

Turn off wikitext and see nicely formatted text such as:

>>>>
Here are some fruits:

        * apples
        * bananas
        * oranges 
<<<<

Now switch back to Wikitext you start seeing the excess </dd> tags. In this case you will see:

>>>>
Here are some fruits:
<dl><dd>


<br> <br>

* apples
* bananas
* oranges

&lt;/dd&gt;
</dd></dl>
<<<<

Every time you switch back and forth, you would see an extra </dd> getting added. Of course, the colon prefix has nothing to do with this behavior as you would see this even if you started like the below in the first place:

>>>>
Here are some fruits:
<dl><dd>
* apples
* bananas
* oranges
</dd></dl>
<<<<

The problem seems to be fundamental to the parsing of <dd></dd> tags, try this and you will see the same extra </dd> tags:

>>>>
Here are some fruits:
<dd>
* apples
* bananas
* oranges
</dd>
<<<<
Comment 1 Christian Neubauer 2008-01-14 20:21:55 UTC
Are you using a WYSIWYG editor like FCKeditor?  It sounds like you are switching back and forth between wikitext and HTML without saving and reediting the page.  Is that right?  If so, the bug probably needs to be filed with the WYSIWYG dev team.
Comment 2 Hari Dara 2008-01-14 21:01:29 UTC
Yes, we do have FCKeditor configured and I realized that soon after I submitted the report so I went into the preferences and disabled the editing option "Enable section editing by right clicking on section titles (JavaScript)" and went back to try it. What I can see is that as soon as I click on Preview button, the extra </dd> gets added, so this problem is not specific to WYSIWYG editor.

To workaround, I am now using <ul> around the list instead of prefixing with colons. When I tried this earlier with WYSIWYG editor, I got into a different kind of problem which is gone when I disabled the above option. The problem with <ul> and WYSIWYG is that though it would look fine in the preview, after submission, it would add an extra bullet to the first item alone, so something like the below:

>>>>
Here are some fruits:
<ul>
* apples
* bananas
* oranges
</ul>
<<<<

would look more like this in the preview:

>>>>
Here are some fruits:

      * * apples
        * bananas
        * oranges 
<<<<

If I switch back to wikitext it would end up as below

>>>>
Here are some fruits:

* apples
* bananas
* oranges

<<<<

Strangely, though the <ul> tags are missing, switching to the preview (or saving) would continue to show the extra bullet (and the indenting is preserved too).
Comment 3 Christian Neubauer 2008-01-14 21:23:23 UTC
(In reply to comment #2)
> Yes, we do have FCKeditor configured and I realized that soon after I submitted
> the report so I went into the preferences and disabled the editing option
> "Enable section editing by right clicking on section titles (JavaScript)" and
> went back to try it. What I can see is that as soon as I click on Preview
> button, the extra </dd> gets added, so this problem is not specific to WYSIWYG
> editor.

That option in preferences doesn't have anything to do with FCKeditor.  If you have a preference called "disable rich text editor" or something like that, that's the one you want to check.  Following the steps in your initial description with a clean installation of 1.11 (with no extensions installed) doesn't cause the problem you are seeing so this is definitely a problem with FCKeditor.

The problem is that FCKeditor is dynamically converting your wikitext into HTML and back every time you click on the "wikitext" or "html" buttons in the editing toolbox.  It uses its own parser to do this, not the MediaWiki parser, so the results aren't perfect.  You have a couple options here:

1.  You can disable FCKeditor.
2.  You can try to fix the FCKeditor parser javascript so that it doesn't keep adding <dd>s everytime it parses an indentation.
3.  You can submit a bug to the FCKeditor team and hope they can fix it. http://dev.fckeditor.net/report/12
Comment 4 Christian Neubauer 2008-01-14 21:27:15 UTC
Actually, it looks like the FCKeditor team is aware of the bug and has it fixed in one of their newer builds.  See http://dev.fckeditor.net/ticket/1003.  Try upgrading your FCKeditor code to the latest version and see if that does the trick.
Comment 5 Aryeh Gregor (not reading bugmail, please e-mail directly) 2008-01-14 21:37:21 UTC
(In reply to comment #2)
> Yes, we do have FCKeditor configured and I realized that soon after I submitted
> the report so I went into the preferences and disabled the editing option
> "Enable section editing by right clicking on section titles (JavaScript)" and
> went back to try it. What I can see is that as soon as I click on Preview
> button, the extra </dd> gets added, so this problem is not specific to WYSIWYG
> editor.

I can't reproduce.  Inputting the text

:* apples
:* bananas
:* oranges

produces the expected result, i.e., a <dl><dd><ul><li>...</li><li>...</li><li>...</li></ul></dd></dl>.

> To workaround, I am now using <ul> around the list instead of prefixing with
> colons. When I tried this earlier with WYSIWYG editor, I got into a different
> kind of problem which is gone when I disabled the above option. The problem
> with <ul> and WYSIWYG is that though it would look fine in the preview, after
> submission, it would add an extra bullet to the first item alone, so something
> like the below:
> 
> >>>>
> Here are some fruits:
> <ul>
> * apples
> * bananas
> * oranges
> </ul>
> <<<<
> 
> would look more like this in the preview:
> 
> >>>>
> Here are some fruits:
> 
>       * * apples
>         * bananas
>         * oranges 
> <<<<

This behavior is expected.  If you wrap a wiki list inside an HTML list, you'll have a list nested inside a list.  You want either

* apples
* bananas
* oranges

or 

<ul>
<li>apples</li>
<li>bananas</li>
<li>oranges</li>
</ul>

Resolving WORKSFORME.  Please reopen if you can find an issue with MediaWiki itself with no external editors, JavaScript widgets, or any other third-party addition.
Comment 6 Hari Dara 2008-01-14 22:31:14 UTC
I copy pasted a wrong preference name. The preference that I played it with was "Show edit toolbar (JavaScript)". When I disabled it, the editor toolbar was gone and I had to explicitly click on the preview button to see the change in action. I did find a preference for disabling rich-text editor and that seems to have solved the problem with the </dl> tags, so you are right that it is a problem with FCKEditor.

Regarding the second problem:

> > would look more like this in the preview:
> > 
> > >>>>
> > Here are some fruits:
> > 
> >       * * apples
> >         * bananas
> >         * oranges 
> > <<<<
> 
> This behavior is expected.  If you wrap a wiki list inside an HTML list, you'll
> have a list nested inside a list.  You want either
> 
> * apples
> * bananas
> * oranges
> 
> or 
> 
> <ul>
> <li>apples</li>
> <li>bananas</li>
> <li>oranges</li>
> </ul>

Not sure what you mean by it is expected. With using <li>, the <ul> tag works fine for me now. The problem that I reported seems to be with, again, FCKEditor.

Thanks for looking into the issue, I will keep rich-text editor disabled.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links