Skip to content

Commit 815edfe

Browse files
authored
Merge pull request #215 from contentful/feature/rich-text-fixes
Feature/rich text fixes
2 parents b7ea68d + a93382b commit 815edfe

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

Contentful.AspNetCore/Contentful.AspNetCore.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<PackageProjectUrl>https://github.com/contentful/contentful.net</PackageProjectUrl>
1414
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1515
<RepositoryType>git</RepositoryType>
16-
<Version>5.0.2</Version>
17-
<AssemblyVersion>5.0.2.0</AssemblyVersion>
16+
<Version>5.0.3</Version>
17+
<AssemblyVersion>5.0.3.0</AssemblyVersion>
1818
<RepositoryUrl>https://github.com/contentful/contentful.net</RepositoryUrl>
1919
</PropertyGroup>
2020
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
@@ -24,7 +24,7 @@
2424
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
2525
</PropertyGroup>
2626
<ItemGroup>
27-
<PackageReference Include="contentful.csharp" Version="5.0.2" />
27+
<PackageReference Include="contentful.csharp" Version="5.0.3" />
2828
<PackageReference Include="gitlink" Version="3.1.0">
2929
<PrivateAssets>all</PrivateAssets>
3030
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>

Contentful.Core/Contentful.Core.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
1919
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
2020
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
21-
<AssemblyVersion>5.0.2.0</AssemblyVersion>
22-
<FileVersion>5.0.2.0</FileVersion>
23-
<Version>5.0.2</Version>
21+
<AssemblyVersion>5.0.3.0</AssemblyVersion>
22+
<FileVersion>5.0.3.0</FileVersion>
23+
<Version>5.0.3</Version>
2424
</PropertyGroup>
2525
<ItemGroup>
2626
<PackageReference Include="gitlink" Version="3.1.0">

Contentful.Core/ContentfulClient.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ private void ResolveLinks(JObject json, JObject entryToken, ISet<string> process
279279
foreach (var linkToken in links)
280280
{
281281
var propName = (linkToken.Parent.Parent.Ancestors().FirstOrDefault(a => a is JProperty) as JProperty)?.Name;
282-
282+
var isRichTextPath = linkToken.Path.EndsWith("data.target.sys");
283283
var linkId = ((JValue)linkToken["id"]).Value.ToString();
284284
JToken replacementToken = null;
285285
if (processedIds.Contains(linkId))
@@ -314,7 +314,7 @@ private void ResolveLinks(JObject json, JObject entryToken, ISet<string> process
314314
{
315315
prop = type?.GetRuntimeProperties().FirstOrDefault(p => (p.Name.Equals(propName, StringComparison.OrdinalIgnoreCase) ||
316316
p.GetCustomAttribute<JsonPropertyAttribute>()?.PropertyName == propName));
317-
if (prop == null && linkToken["linkType"]?.ToString() != "Asset")
317+
if (prop == null && linkToken["linkType"]?.ToString() != "Asset" && !isRichTextPath)
318318
{
319319
//the property does not exist in the entry. Skip it in resolving references.
320320
continue;

Contentful.Core/Models/Management/SystemFieldTypes.cs

+5
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,10 @@ public class SystemFieldTypes
5959
/// </summary>
6060
public const string Object = "Object";
6161

62+
/// <summary>
63+
/// An rich text document.
64+
/// </summary>
65+
public const string RichText = "RichText";
66+
6267
}
6368
}

0 commit comments

Comments
 (0)