Design

HTML

HTML Rendering for Documents: Transforming WYSIWYG and AI-Generated HTML into ODT, DOCX, and PDF.
ENTERPRISE FEATURE Available for:
Carbone Cloud
Carbone On-premise
Embedded Carbone JS
  v5.0+ 

:html

Compatible with ODT, DOCX and PDF files.

The :html formatter allows you to render a variety of HTML tags within your documents. Currently, the following tags are supported: <br>, <b>, <strong>, <i>, <em>, <u>, <s>, <p>, <a href="URL">, <ol>, <ul>, <li>, <del> and <img>. Unsupported tags, and attributes are skipped and not rendered at this time.

CSS Styles

The :html formatter supports inline CSS style attributes color and background-color. Styles defined within a <style> element, or those applied through classes and IDs, are not supported. Here is an example of how to use inline style attributes:

<p style="color:green;background-color:#FF00FF"><b>OK</b></p> 

Supported Color Formats:

Additional styles will be supported in upcoming updates.

Options Available:

Important Notes:

HTML Example 1

data
{
  "name" : "<b>raptor</b>",
  "description" : "The engine is <u>powered</u> by <i>cryogenic liquid methane</i><br>and<br><b><i>liquid oxygen</i></b> (LOX),<br><s>rather than the RP-1 kerosene and LOX</s>."
}
template
{d.name:html}
{d.description:html}
Carbone Merge Icon
result
raptor
The engine is powered by cryogenic liquid methane
and
liquid oxygen (LOX),
rather than the RP-1 kerosene and LOX.

HTML Example 2

The :html formatter creates new paragraph.

data
{
  "name" : 'Banana',
  "description" : '<p><b>is an elongated, edible fruit</b></p>'
}
template
The famous fruit {d.name} {d.description:html}, botanically a berry.
Carbone Merge Icon
result
The famous fruit Banana
is an elongated, edible fruit
, botanically a berry.

HTML Nospace Example

data
{
  "name" : 'Banana',
  "description" : '<p><b>is an elongated, edible fruit</b></p>'
}
template
The famous fruit {d.name} {d.description:html(nospace)}, botanically a berry.
Carbone Merge Icon
result
The famous fruit Banana
is an elongated, edible fruit
, botanically a berry.

HTML Inline Example

data
{
  "value" : "<b>The text is injected within the current paragraph</b>",
}
template
After
Beginning - {d.value:html(inline)} - End
Before
Carbone Merge Icon
result
After
Beginning - The text is injected within the current paragraph - End
Before