---
title: "Asset Transformations & UI Rendering"
description: "Fix issues with applying image transformation parameters and resolve Markdown or JSON RTE rendering failures in SDK output."
url: "https://www.contentstack.com/docs/headless-cms/asset-transformations-ui-rendering"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-05-12"
---

# Asset Transformations & UI Rendering

## 1\. SDK Asset URL Transformation Parameters Not Applying

Developers attempt to resize an asset using SDK helper methods (e.g., .width(200)), but the resulting URL does not contain the transformation parameters.

**Root Cause**

Transformation methods are being chained on the URL string directly rather than using the ImageTransform class required by modern SDK versions to generate valid query parameters.

**Resolution**

Legacy chaining assumptions can generate unchanged URLs when transformation objects are not applied correctly.

1.  Build transform instructions with ImageTransform.
2.  Apply transformation through the SDK URL transform API.
3.  Confirm the asset is an image and not a non-transformable file type.

import { ImageTransform, Format } from '@contentstack/delivery-sdk';
const transform = new ImageTransform().resize({ width: 200 }).format(Format.PJPG);
const transformedUrl = assetUrl.transform(transform);

The generated URL contains expected transform parameters (for example width=200) and transformed asset loads. Escalate with original URL, transformed URL, and asset MIME type.

* * *

## 2\. Raw Markdown Returned Instead of HTML in SDK Output

Content from Markdown fields is returned as raw Markdown syntax in the SDK response, leading to formatting issues on the live site.

**Root Cause**

Contentstack APIs return raw data (Markdown or JSON RTE) to maintain a headless architecture; the responsibility of parsing and rendering this data lies with the frontend application.

**Resolution**

SDK responses intentionally return raw markdown content; HTML rendering is application responsibility.

1.  Classify the field first:
    *   **Markdown field** -> expect raw markdown string from SDK.
    *   **JSON RTE field** -> expect structured JSON, not pre-rendered HTML.
2.  For JSON RTE content that includes embedded entries/assets, fetch with SDK query helpers such as .includeEmbeddedItems().
3.  For reference fields used in render paths, include linked content using .includeReference(...) where needed.
4.  Render in the application layer:
    *   Markdown -> parse with your app’s markdown renderer.
    *   JSON RTE -> render through your rich-text renderer/component pipeline.
5.  Sanitize final HTML output according to frontend security policy before DOM injection.
6.  If output is still raw, verify the UI render path is not escaping HTML as plain text.

API response returns raw markdown/JSON RTE as expected, and frontend render output shows formatted HTML with embedded items resolved where configured. Escalate with field type (Markdown vs JSON RTE), sample payload, query helper usage (includeEmbeddedItems/includeReference), and renderer configuration.