Skip to content

Commit 91f4f4e

Browse files
Merge pull request #41 from contentstack/staging
DX | 19-01-2026 | Release
2 parents e3ec2d5 + eb0e462 commit 91f4f4e

File tree

8 files changed

+26
-5
lines changed

8 files changed

+26
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### Version: 1.0.7
2+
#### Date: January-12-2026
3+
- Improved error messages
4+
15
### Version: 1.0.6
26
#### Date: June-09-2025
37
- Used 'title' and 'target' in a tags

Contentstack.Utils.Tests/DefaultRenderTest.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,11 @@ public void testLinkhDocument()
178178

179179
string result = defaultRender.RenderNode("a", nodeLink, (nodes) => { return text; });
180180

181-
Assert.Equal($"<a href=\"{nodeLink.attrs["url"]}\" target=\"{nodeLink.attrs["target"]}\" title=\"{nodeLink.attrs["title"]}\" >Text To set Link</a>", result);
181+
string url = nodeLink.attrs.ContainsKey("url") ? (string)nodeLink.attrs["url"] : "";
182+
string target = nodeLink.attrs.ContainsKey("target") ? (string)nodeLink.attrs["target"] : "";
183+
string title = nodeLink.attrs.ContainsKey("title") ? (string)nodeLink.attrs["title"] : "";
184+
185+
Assert.Equal($"<a href=\"{url}\" target=\"{target}\" title=\"{title}\" >Text To set Link</a>", result);
182186
}
183187

184188
[Fact]

Contentstack.Utils.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Global
2121
{EB2B5E23-E45F-4C6C-BF98-FE3971DE4250}.Release|Any CPU.Build.0 = Release|Any CPU
2222
EndGlobalSection
2323
GlobalSection(MonoDevelopProperties) = preSolution
24-
version = 1.0.6
24+
version = 1.0.7
2525
Policies = $0
2626
$0.DotNetNamingPolicy = $1
2727
$1.DirectoryNamespaceAssociation = PrefixedHierarchical
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace Contentstack.Utils.Constants
2+
{
3+
/// <summary>
4+
/// Centralized error messages for the Contentstack Utils library
5+
/// </summary>
6+
public static class ErrorMessages
7+
{
8+
public const string InvalidRteJson = "Invalid RTE JSON. Provide a valid JSON structure and try again.";
9+
}
10+
}
11+

Contentstack.Utils/Contentstack.Utils.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<Folder Include="Enums\" />
3737
<Folder Include="Extensions\" />
3838
<Folder Include="Converters\" />
39+
<Folder Include="Constants\" />
3940
</ItemGroup>
4041
<ItemGroup>
4142
<PackageReference Include="HtmlAgilityPack" Version="1.11.46" />

Contentstack.Utils/Converters/RTEJsonConverter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
using System.Reflection;
44
using Newtonsoft.Json;
55
using Newtonsoft.Json.Linq;
6+
using Contentstack.Utils.Constants;
67

78
namespace Contentstack.Utils.Converters
89
{
910
public class RTEJsonConverter : JsonConverter
1011
{
1112
public override bool CanConvert(Type objectType)
1213
{
13-
throw new NotImplementedException();
14+
throw new InvalidOperationException(ErrorMessages.InvalidRteJson);
1415
}
1516

1617
public override object ReadJson(JsonReader reader, Type objectType,

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>1.0.6</Version>
3+
<Version>1.0.7</Version>
44
</PropertyGroup>
55
</Project>

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright © 2012-2025 Contentstack. All Rights Reserved
3+
Copyright © 2012-2026 Contentstack. All Rights Reserved
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)