3
Vote

Parse list and *

description

When I try to parse a simple list, the closing </li> tags are placed after all <li> items:
Expected: "<ul><li>one</li><li>two</li></ul>"
But was: "<ul><li>one<li>two</li></li></ul>"
 
Test:
// Arrange
var input = "[list][]one[]two[/list]";
//Act
var result = BBCode.ToHtml(input);
// Assert
Assert.AreEqual("<ul><li>one</li><li>two</li></ul>", result);

comments

Moath88 wrote Nov 16, 2013 at 3:05 PM

Hi,

Try this:
new BBTag("*", "<li>", "</li>", true, BBTagClosingStyle.AutoCloseElement,
                        (string content)=> content.TrimEnd('\r', '\n'), true),