Changeset 3414

Show
Ignore:
Timestamp:
03/24/08 04:24:23 (10 months ago)
Author:
jun66j5
Message:

fixed #2684 - a problem that tracwysiwyg can't parse lists including citations.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tracwysiwygplugin/0.10/tests/testcase.js

    r3255 r3414  
    976976                "", 
    977977                " 1. item 1" ].join("\n")); 
     978        }); 
     979 
     980        unit.add("list + citation", function() { 
     981            var dom = fragment( 
     982                element('ol', element('li', 'item 1')), 
     983                element('blockquote', { 'class': 'citation' }, element("p", "citation 1")), 
     984                element('ul', 
     985                    element('li', 'item 2'), 
     986                    element("ol", 
     987                        element('li', 'item 2.1'), 
     988                        element('li', 'item 2.2'))), 
     989                element('blockquote', { 'class': 'citation' }, element("p", "citation 2 citation 3")), 
     990                element('ol', element('li', 'item 3'))); 
     991            generateFragment.call(this, dom, [ 
     992                ' 1. item 1', 
     993                '> citation 1', 
     994                ' * item 2', 
     995                '   1. item 2.1', 
     996                '   1. item 2.2', 
     997                '> citation 2', 
     998                '> citation 3', 
     999                ' 1. item 3' ].join("\n")); 
     1000            generateWikitext.call(this, dom, [ 
     1001                ' 1. item 1', 
     1002                '', 
     1003                '> citation 1', 
     1004                '', 
     1005                ' * item 2', 
     1006                '   1. item 2.1', 
     1007                '   1. item 2.2', 
     1008                '', 
     1009                '> citation 2 citation 3', 
     1010                '', 
     1011                ' 1. item 3' ].join("\n")); 
    9781012        }); 
    9791013 
  • tracwysiwygplugin/0.10/tracwysiwyg/htdocs/wysiwyg.js

    r3255 r3414  
    12991299 
    13001300        if (depth > quoteDepth.length) { 
    1301             closeParagraph(); 
     1301            closeToFragment("blockquote"); 
    13021302            while (depth > quoteDepth.length) { 
    13031303                openQuote((new RegExp("^(?: *>){" + (quoteDepth.length + 1) + "}")).exec(quote)[0].length, true); 
     
    15101510        var last = listDepth.length - 1; 
    15111511        if (depth > (last >= 0 ? listDepth[last] : 0)) { 
    1512             closeParagraph(); 
     1512            closeToFragment("li"); 
    15131513            openList(tag, className, start, depth); 
    15141514        } 
  • tracwysiwygplugin/0.11/tests/testcase.js

    r3255 r3414  
    976976                "", 
    977977                " 1. item 1" ].join("\n")); 
     978        }); 
     979 
     980        unit.add("list + citation", function() { 
     981            var dom = fragment( 
     982                element('ol', element('li', 'item 1')), 
     983                element('blockquote', { 'class': 'citation' }, element("p", "citation 1")), 
     984                element('ul', 
     985                    element('li', 'item 2'), 
     986                    element("ol", 
     987                        element('li', 'item 2.1'), 
     988                        element('li', 'item 2.2'))), 
     989                element('blockquote', { 'class': 'citation' }, element("p", "citation 2 citation 3")), 
     990                element('ol', element('li', 'item 3'))); 
     991            generateFragment.call(this, dom, [ 
     992                ' 1. item 1', 
     993                '> citation 1', 
     994                ' * item 2', 
     995                '   1. item 2.1', 
     996                '   1. item 2.2', 
     997                '> citation 2', 
     998                '> citation 3', 
     999                ' 1. item 3' ].join("\n")); 
     1000            generateWikitext.call(this, dom, [ 
     1001                ' 1. item 1', 
     1002                '', 
     1003                '> citation 1', 
     1004                '', 
     1005                ' * item 2', 
     1006                '   1. item 2.1', 
     1007                '   1. item 2.2', 
     1008                '', 
     1009                '> citation 2 citation 3', 
     1010                '', 
     1011                ' 1. item 3' ].join("\n")); 
    9781012        }); 
    9791013 
  • tracwysiwygplugin/0.11/tracwysiwyg/htdocs/wysiwyg.js

    r3255 r3414  
    12991299 
    13001300        if (depth > quoteDepth.length) { 
    1301             closeParagraph(); 
     1301            closeToFragment("blockquote"); 
    13021302            while (depth > quoteDepth.length) { 
    13031303                openQuote((new RegExp("^(?: *>){" + (quoteDepth.length + 1) + "}")).exec(quote)[0].length, true); 
     
    15101510        var last = listDepth.length - 1; 
    15111511        if (depth > (last >= 0 ? listDepth[last] : 0)) { 
    1512             closeParagraph(); 
     1512            closeToFragment("li"); 
    15131513            openList(tag, className, start, depth); 
    15141514        }