예제 #1
0
        public override void AppendHTML(StringBuilder builder, Stack <EMInclude> includesStack, TransformationData data)
        {
            var parameters = new Hash();

            foreach (var paramPair in literalParams)
            {
                List <string> paramStrings = new List <string>();
                if (paramPair.Value.Count > 1)
                {
                    foreach (var param in paramPair.Value)
                    {
                        paramStrings.Add(param);
                    }
                    parameters.Add(paramPair.Key, paramStrings.ToArray());
                }
                else if (paramPair.Value.Count > 0)
                {
                    parameters.Add(paramPair.Key, paramPair.Value[0]);
                }
            }

            foreach (var paramPair in markdownParams)
            {
                List <string> paramStrings = new List <string>();
                if (paramPair.Value.Count > 1)
                {
                    foreach (var param in paramPair.Value)
                    {
                        paramStrings.Add(param.Elements.GetInnerHTML(includesStack, data));
                    }
                    parameters.Add(paramPair.Key, paramStrings.ToArray());
                }
                else if (paramPair.Value.Count > 0)
                {
                    parameters.Add(paramPair.Key, paramPair.Value[0].Elements.GetInnerHTML(includesStack, data));
                }
            }

            builder.Append(template.Render(parameters));
        }