Skip to content

Commit 137c89a

Browse files
committed
feat: ✨ fragment tag support added
1 parent dc678b5 commit 137c89a

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
### Version: 1.0.2
33
#### Date: Mar-14-2024
44
- Style attributes supported in converted HTML.
5+
- Fragment tag support added
56

67
### Version: 1.0.1
78
#### Date: July-16-2021

Contentstack.Utils.Tests/DefaultRenderTest.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,14 @@ public void testEmbedDocument()
197197
Assert.Equal($"<iframe src=\"\">{text}</iframe>", result);
198198
}
199199

200+
[Fact]
201+
public void testFragmentDocument()
202+
{
203+
string result = defaultRender.RenderNode("fragment", node, (nodes) => { return text; });
204+
205+
Assert.Equal($"<fragment>{text}</fragment>", result);
206+
}
207+
200208
[Fact]
201209
public void testH1Document()
202210
{

Contentstack.Utils/Models/Options.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ public virtual string RenderNode(string nodeType, Node node, NodeChildrenCallBac
135135
href = (string)node.attrs["url"];
136136
}
137137
return $"<iframe{styleAttrs} src=\"{href}\">{callBack(node.children)}</iframe>";
138+
case "fragment":
139+
return $"<fragment{styleAttrs}>{callBack(node.children)}</fragment>";
138140
case "h1":
139141
return $"<h1{styleAttrs}>{callBack(node.children)}</h1>";
140142
case "h2":

0 commit comments

Comments
 (0)