예제 #1
0
        public void GetTagAttributesEmpty()
        {
            var op = new DeltaInsertOp("hello");
            var c  = new OpToXmlConverter(op);

            c.GetTagAttributes().Should().BeEquivalentTo(new TagKeyValue[] { });
        }
예제 #2
0
        public void GetTagAttributesEmptyText()
        {
            var o = new DeltaInsertOp("",
                                      new OpAttributes {
                Code = true, Color = "red"
            });
            var c = new OpToXmlConverter(o);

            c.GetTagAttributes().Should().BeEquivalentTo(new TagKeyValue[] { });
        }
예제 #3
0
        public void GetTagAttributesFormulaIgnoresColour()
        {
            var o = new DeltaInsertOp(new InsertDataFormula("-"),
                                      new OpAttributes {
                Color = "red"
            });
            var c = new OpToXmlConverter(o);

            c.GetTagAttributes().Should().BeEquivalentTo(new TagKeyValue[] {
                new TagKeyValue("class", "ql-formula")
            });
        }
예제 #4
0
        public void GetTagAttributesLinkUsesColour()
        {
            var o = new DeltaInsertOp("link",
                                      new OpAttributes {
                Color = "red", Link = "l"
            });
            var c = new OpToXmlConverter(o);

            c.GetTagAttributes().Should().BeEquivalentTo(new TagKeyValue[] {
                new TagKeyValue("style", "color:red"),
                new TagKeyValue("href", "l")
            });
        }
예제 #5
0
        public void GetTagAttributesImageIgnoresColour()
        {
            var o = new DeltaInsertOp(new InsertDataImage("http:"),
                                      new OpAttributes {
                Color = "red"
            });
            var c = new OpToXmlConverter(o);

            c.GetTagAttributes().Should().BeEquivalentTo(new TagKeyValue[] {
                new TagKeyValue("class", "ql-image"),
                new TagKeyValue("src", "http:")
            });
        }
예제 #6
0
        public void GetTagAttributesImageIncludesWidth()
        {
            var o = new DeltaInsertOp(new InsertDataImage("http:"),
                                      new OpAttributes {
                Width = "200"
            });
            var c = new OpToXmlConverter(o);

            c.GetTagAttributes().Should().BeEquivalentTo(new TagKeyValue[] {
                new TagKeyValue("class", "ql-image"),
                new TagKeyValue("width", "200"),
                new TagKeyValue("src", "http:")
            });
        }
예제 #7
0
        public void GetTagAttributesVideoIgnoresColour()
        {
            var o = new DeltaInsertOp(new InsertDataVideo("http:"),
                                      new OpAttributes {
                Color = "red"
            });
            var c = new OpToXmlConverter(o);

            c.GetTagAttributes().Should().BeEquivalentTo(new TagKeyValue[] {
                new TagKeyValue("class", "ql-video"),
                new TagKeyValue("frameborder", "0"),
                new TagKeyValue("allowfullscreen", "true"),
                new TagKeyValue("src", "http:")
            });
        }
예제 #8
0
        public void GetTagAttributesLinkNoFollowOptionWorks()
        {
            var o = new DeltaInsertOp("link",
                                      new OpAttributes {
                Color = "red", Link = "l"
            });
            var c = new OpToXmlConverter(o,
                                         new OpToXmlConverterOptions {
                LinkRel = "nofollow"
            });

            c.GetTagAttributes().Should().BeEquivalentTo(new TagKeyValue[] {
                new TagKeyValue("style", "color:red"),
                new TagKeyValue("href", "l"),
                new TagKeyValue("rel", "nofollow")
            });
        }