Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### Version: 1.0.7
#### Date: January-12-2026
- Improved error messages

### Version: 1.0.6
#### Date: June-09-2025
- Used 'title' and 'target' in a tags
Expand Down
6 changes: 5 additions & 1 deletion Contentstack.Utils.Tests/DefaultRenderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,11 @@ public void testLinkhDocument()

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

Assert.Equal($"<a href=\"{nodeLink.attrs["url"]}\" target=\"{nodeLink.attrs["target"]}\" title=\"{nodeLink.attrs["title"]}\" >Text To set Link</a>", result);
string url = nodeLink.attrs.ContainsKey("url") ? (string)nodeLink.attrs["url"] : "";
string target = nodeLink.attrs.ContainsKey("target") ? (string)nodeLink.attrs["target"] : "";
string title = nodeLink.attrs.ContainsKey("title") ? (string)nodeLink.attrs["title"] : "";

Assert.Equal($"<a href=\"{url}\" target=\"{target}\" title=\"{title}\" >Text To set Link</a>", result);
}

[Fact]
Expand Down
2 changes: 1 addition & 1 deletion Contentstack.Utils.sln
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Global
{EB2B5E23-E45F-4C6C-BF98-FE3971DE4250}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
version = 1.0.6
version = 1.0.7
Policies = $0
$0.DotNetNamingPolicy = $1
$1.DirectoryNamespaceAssociation = PrefixedHierarchical
Expand Down
11 changes: 11 additions & 0 deletions Contentstack.Utils/Constants/ErrorMessages.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Contentstack.Utils.Constants
{
/// <summary>
/// Centralized error messages for the Contentstack Utils library
/// </summary>
public static class ErrorMessages
{
public const string InvalidRteJson = "Invalid RTE JSON. Provide a valid JSON structure and try again.";
}
}

1 change: 1 addition & 0 deletions Contentstack.Utils/Contentstack.Utils.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<Folder Include="Enums\" />
<Folder Include="Extensions\" />
<Folder Include="Converters\" />
<Folder Include="Constants\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="HtmlAgilityPack" Version="1.11.46" />
Expand Down
3 changes: 2 additions & 1 deletion Contentstack.Utils/Converters/RTEJsonConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
using System.Reflection;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Contentstack.Utils.Constants;

namespace Contentstack.Utils.Converters
{
public class RTEJsonConverter : JsonConverter
{
public override bool CanConvert(Type objectType)
{
throw new NotImplementedException();
throw new InvalidOperationException(ErrorMessages.InvalidRteJson);
}

public override object ReadJson(JsonReader reader, Type objectType,
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<Version>1.0.6</Version>
<Version>1.0.7</Version>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright © 2012-2025 Contentstack. All Rights Reserved
Copyright © 2012-2026 Contentstack. All Rights Reserved

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