Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="inAlignName"></param>
        private void ReplacePadding(string inAlignName)
        {
            var inNodeClassList = new List <string> {
                "p-", "pt-", "pr-", "pb-", "pl-", "px-", "py-"
            };
            var tmpChildNodes = GetNodesByFunction((inNode) => FoundClassesWithStart(inNode, inNodeClassList).Any(), DocumentBody);

            foreach (IElement tmpNode in tmpChildNodes.ToList())
            {
                if (tmpNode.LocalName != "table")
                {
                    var tmpClasses = FoundClassesWithStart(tmpNode, inNodeClassList);
                    foreach (var tmpClass in tmpClasses)
                    {
                        tmpNode.ClassList.Remove(tmpClass);
                    }
                    var tmpDict = new Dictionary <string, string>()
                    {
                        { "classes", string.Join(" ", tmpNode.ClassList) },
                        { "contents", tmpNode.OuterHtml },
                    };

                    var tmpNewNodeHtml = Template("table", tmpDict);
                    tmpNode.Replace(EmailHtml.CreateElement(tmpNewNodeHtml), tmpNode);
                }
            }
        }
Пример #2
0
        private INode bootstrap_email_head()
        {
            var tmpNode = EmailHtml.CreateElement("div");

            tmpNode.InnerHtml = "<div><title></title></div>";
            var tmpcss = Scss.ConvertToCss(LoadFile("", "head.scss"), new ScssOptions()
            {
                OutputStyle = ScssOutputStyle.Compressed
            });

            tmpNode.InnerHtml = $"<style type=\"text/css\">" + tmpcss.Css + "</style>";
            return(tmpNode);
        }