pekkah / Tanka.Markdown

Extensible markdown parser
7 stars 2 forks source link

In HTML Rendrer only first element are ok #18

Open hicham-barhoumi opened 9 years ago

hicham-barhoumi commented 9 years ago

ex * * strong * * strong2 * * => < strong >strong</ strong > </ strong >strong2</ strong > correct => < strong >strong</ strong > < strong >strong2</ strong >

namespace Tanka.Markdown.Html
{
    public class OpenAndCloseRenderer<T> : ISpanRenderer where T : Span
    {
        protected virtual void Render(T span, StringBuilder builder)
        {
            if (_hasStarted)
            {
                builder.AppendFormat("</{0}>", _tag);
                _hasStarted = false;// this line fix the problem.
                return;
            }
            _hasStarted = true;
            builder.AppendFormat("<{0}>", _tag);
        }
    }
}
pekkah commented 8 years ago

Known issue at the moment. Will try to fix it at some point. Currently doing some overall refactoring to match the CommonMark spec.