> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# `<markdown>`

APISummary
`<markdown>` renders Markdown content in Lynx, including headings, paragraphs, block quotes, lists, code, links, images, and tables. It also supports embedded Lynx views, typewriter animation, and text selection.

The host must integrate and register this native element. Run the examples in a Lynx Explorer build that includes `<markdown>`. See [Compatibility](#compatibility) for platform support of individual attributes and methods.

## Usage

### Basic

**This is an example below: markdown**

**Bundle:** `dist/basic.lynx.bundle` | Web: `dist/basic.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { renderExample } from "../common.js";

function App() {
  const content = `
this is a **Markdown**!!
`;

  return (
    <view className="plain-surface">
      <markdown content={content} />
    </view>
  );
}

renderExample("Basic", <App />);

```

v0.2.2



The above code demonstrates the simplest way to use it. Simply pass the Markdown-formatted text to the `content` prop of `<markdown>`. It will render a static Markdown page using the default styles.

### Modify Styles

The inner elements of `<markdown>` are not Lynx elements, so they cannot be styled using CSS. However, we can use the `markdown-style` attribute to modify the styles of inner elements.

**This is an example below: markdown**

**Bundle:** `dist/style.lynx.bundle` | Web: `dist/style.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { renderExample } from "../common.js";
import type { MarkdownStyle } from "../intrinsic-element.js";

function App() {
  const content = `
this is a **Markdown**!!

this is a \`inline code\`.
`;
  const style: MarkdownStyle = {
    normalText: {
      fontSize: 25,
    },
    inlineCode: {
      fontSize: 20,
      color: "ff0000",
    },
  };

  return (
    <view className="plain-surface">
      <markdown content={content} markdown-style={style} />
    </view>
  );
}

renderExample("Style", <App />);

```

v0.2.2



In the above code, we passed an object through the `markdown-style` attribute. This object represents the style configuration for all `normalText` elements (i.e., regular text) and `inlineCode` elements (i.e., inline code). In this case, we set the font size of all `normalText` elements to 25px and the font size of all `inlineCode` elements to 20px, with a color of red.

`markdown-style` is just such a series of tag-to-style configuration mappings. By using it, we can modify the style of a specific syntax. See [Stylesheets](#stylesheets) for the supported tags and their configuration options.

#### `<span>` tag

By using tags, we can modify the style of all text of the same type. For example:

**This is an example below: markdown**

**Bundle:** `dist/link_style.lynx.bundle` | Web: `dist/link_style.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { renderExample } from "../common.js";
import type { MarkdownStyle } from "../intrinsic-element.js";

function App() {
  const content = `
this is [link1](url1).

this is [link2](url1).
`;
  const style: MarkdownStyle = {
    link: {
      color: "ff0000",
    },
  };

  return (
    <view className="plain-surface">
      <markdown content={content} markdown-style={style} />
    </view>
  );
}

renderExample("Link Style", <App />);

```

v0.2.2



In the above code, both `link1` and `link2` will be affected by the `link` in the style sheet and thus set to red.

But what if we only want to modify the color of `link1`? `<markdown>` supports the simple `<span>` tag. We can wrap `link1` with a `<span>` tag that has a class, and then configure the style corresponding to this class in `markdown-style`.

**This is an example below: markdown**

**Bundle:** `dist/span_style.lynx.bundle` | Web: `dist/span_style.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { renderExample } from "../common.js";
import type { MarkdownStyle } from "../intrinsic-element.js";

function App() {
  const content = `
this is [<span class="red">link1</span>](url1).

this is [link2](url1).
`;
  const style: MarkdownStyle = {
    ".red": {
      color: "ff0000",
    },
    link: {
      color: "0000ff",
    },
  };

  return (
    <view className="plain-surface">
      <markdown content={content} markdown-style={style} />
    </view>
  );
}

renderExample("Span Style", <App />);

```

v0.2.2



In the above code, we wrapped `link1` with a `<span>` tag that has a class `red`, and then set the style of this class in `markdown-style`.

#### `<p>` tag

Similarly, we can use the `<p>` tag to set the style of paragraphs, such as line height and alignment:

**This is an example below: markdown**

**Bundle:** `dist/paragraph_style.lynx.bundle` | Web: `dist/paragraph_style.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { renderExample } from "../common.js";
import type { MarkdownStyle } from "../intrinsic-element.js";

function App() {
  const content = `
<p class="center">paragraph alignment is center.</p>

<p class="right">paragraph alignment is right.</p>
`;
  const style: MarkdownStyle = {
    ".center": {
      textAlign: "center",
    },
    ".right": {
      textAlign: "right",
    },
  };

  return (
    <view className="plain-surface">
      <markdown content={content} markdown-style={style} />
    </view>
  );
}

renderExample("Paragraph Style", <App />);

```

v0.2.2



The supported HTML tags are `<span>` for text styles and `<p>` for paragraph styles. Define their styles through a class in `markdown-style`; inline HTML styles and other HTML tags are not supported.

### Images

Inserting images in `<markdown>` is just like Markdown. For example:

**This is an example below: markdown**

**Bundle:** `dist/image.lynx.bundle` | Web: `dist/image.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { renderExample } from "../common.js";

const imageUrl = "https://upload.wikimedia.org/wikipedia/commons/b/be/Grapefruit_free.jpg";

function App() {
  const content = `
image:
![alt text](${imageUrl})
  `;

  return (
    <view className="plain-surface">
      <markdown content={content}></markdown>
    </view>
  );
}

renderExample("Image", <App />);

```

v0.2.2



#### Image Size

Markdown does not support directly controlling the size of inserted images. However, `<markdown>` supports adding `width` and `height` to the image URL to control the size of the image.

**This is an example below: markdown**

**Bundle:** `dist/image_size.lynx.bundle` | Web: `dist/image_size.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { renderExample } from "../common.js";

const imageUrl = "https://upload.wikimedia.org/wikipedia/commons/b/be/Grapefruit_free.jpg";

function App() {
  const content = `
image:

![alt text](${imageUrl} width=100 height=100)
  `;

  return (
    <view className="plain-surface">
      <markdown content={content}></markdown>
    </view>
  );
}

renderExample("Image Size", <App />);

```

v0.2.2



The values of `width` and `height` must be numbers in px, with no spaces around the equals sign.

#### Image Captions

`<markdown>` supports image caption syntax, just like Markdown. Adding a caption is as simple as `![alt text](url "caption")`.

**This is an example below: markdown**

**Bundle:** `dist/image_caption.lynx.bundle` | Web: `dist/image_caption.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { renderExample } from "../common.js";

const imageUrl = "https://upload.wikimedia.org/wikipedia/commons/b/be/Grapefruit_free.jpg";

function App() {
  const content = `
image:

![alt text](${imageUrl} width=100 height=100 "a grapefruit")
  `;

  return (
    <view className="plain-surface">
      <markdown content={content}></markdown>
    </view>
  );
}

renderExample("Image Caption", <App />);

```

v0.2.2



Similar to other text, the image caption can also have its style configured through `markdown-style`. The `imageCaption` configuration item in `markdown-style` is used to set the style of the image caption. For specific configuration items, see [Style Sheet](#stylesheets).

**This is an example below: markdown**

**Bundle:** `dist/image_caption_style.lynx.bundle` | Web: `dist/image_caption_style.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { renderExample } from "../common.js";
import type { MarkdownStyle } from "../intrinsic-element.js";

const imageUrl = "https://upload.wikimedia.org/wikipedia/commons/b/be/Grapefruit_free.jpg";

function App() {
  const content = `
image:

![alt text](${imageUrl} width=100 height=100 "a grapefruit")
  `;
  const style: MarkdownStyle = {
    imageCaption: {
      color: "808080",
      fontSize: 13,
      textAlign: "left",
    },
  };

  return (
    <view className="plain-surface">
      <markdown content={content} markdown-style={style}>
        {" "}
      </markdown>
    </view>
  );
}

renderExample("Image Caption Style", <App />);

```

v0.2.2



#### GIF

Android supports GIF animation by default. Set `enable-gif={true}` to enable it on iOS.

**This is an example below: markdown**

**Bundle:** `dist/gif.lynx.bundle` | Web: `dist/gif.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { renderExample } from "../common.js";

const gifUrl = "https://upload.wikimedia.org/wikipedia/commons/3/32/Earth_rotation.gif";

function App() {
  const content = `
gif:

![](${gifUrl})
  `;

  return (
    <view className="plain-surface">
      <markdown content={content} enable-gif={true}>
        {" "}
      </markdown>
    </view>
  );
}

renderExample("GIF", <App />);

```

v0.2.2



### Embedded Lynx Views

Markdown's syntax is quite limited, and to implement some complex cases, we can insert some custom Lynx Views. For example, we can insert a gradient color text:

**This is an example below: markdown**

**Bundle:** `dist/inline_view.lynx.bundle` | Web: `dist/inline_view.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { renderExample } from "../common.js";
import type { MarkdownStyle } from "../intrinsic-element.js";

function App() {
  const content = `
this is a ![](inlineview://mkd)!!
  `;
  const style: MarkdownStyle = {
    normalText: {
      fontSize: 20,
    },
  };

  return (
    <view className="plain-surface">
      <markdown content={content} markdown-style={style}>
        <view id="mkd" className="inline-mark" flatten={false}>
          <text className="inline-mark-text">
            Markdown
          </text>
        </view>
      </markdown>
    </view>
  );
}

renderExample("Inline View", <App />);

```

v0.2.2



In the above code, we inserted a gradient color text by using `![](inlineview://mkd)`. The `mkd` view is a child view of `markdown`, and it contains the gradient color text we need.

inlineview can be set `vertical-align` to configure the vertical alignment. The default value is `baseline`, and in the above code, we set it to `center` to make the text align properly.

inlineview **_must_** be a child view of `markdown`, and `flatten` must be set to `false` to avoid rendering issues.

### Text Marks

#### Highlight and Underline a Span

Assign a class to `<span>`, then configure its `backgroundImage`, `textDecorationLine`, and related properties in `markdown-style`.

**This is an example below: markdown**

**Bundle:** `dist/span_mark.lynx.bundle` | Web: `dist/span_mark.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { renderExample } from "../common.js";
import type { MarkdownStyle } from "../intrinsic-element.js";

function App() {
  const content = `
<span class="hl">highlighted text</span>, <span class="uline">underlined text</span>.
`;
  const style: MarkdownStyle = {
    ".hl": {
      backgroundImage:
        "linear-gradient(180deg, rgba(255, 245, 157, 0) 0%, rgba(255, 245, 157, 0) 60%, rgba(255, 245, 157, 1) 60%, rgba(255, 245, 157, 1) 100%)",
      paddingLeft: 2,
      paddingRight: 2,
    },
    ".uline": {
      textDecorationLine: "underline",
      textDecorationColor: "ff9800",
      textDecorationStyle: "solid",
      textDecorationThickness: 2,
    },
  };

  return (
    <view className="plain-surface">
      <markdown content={content} markdown-style={style} />
    </view>
  );
}

renderExample("Span Mark", <App />);

```

v0.2.2



#### Mark a Text Range

Use `text-mark-attachments` to apply highlights, borders, or gradient underlines to a range. `indexType="source"` indexes the Markdown source; `indexType="char"` indexes parsed characters.

**This is an example below: markdown**

**Bundle:** `dist/text_mark_attachments.lynx.bundle` | Web: `dist/text_mark_attachments.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { renderExample } from "../common.js";
import type { MarkdownMarkAttachment } from "../intrinsic-element.js";

function App() {
  const content = `
highlighted text, overlapping text, underlined text.
`;
  const attachments: MarkdownMarkAttachment[] = [
    {
      startIndex: 0,
      endIndex: 35,
      indexType: "source",
      style: {
        color:
          "linear-gradient(180deg, rgba(255, 245, 157, 0) 0%, rgba(255, 245, 157, 0) 60%, rgba(255, 245, 157, 1) 60%, rgba(255, 245, 157, 1) 100%)",
      },
    },
    {
      startIndex: 18,
      endIndex: 53,
      indexType: "source",
      style: {
        borderBottom: {
          lineType: "dashed",
          width: "2px",
          color:
            "linear-gradient(90deg,rgba(42, 123, 155, 1) 0%, rgba(87, 199, 133, 1) 50%, rgba(237, 221, 83, 1) 100%)",
        },
      },
    },
  ];

  return (
    <view className="plain-surface">
      <markdown content={content} text-mark-attachments={attachments} />
    </view>
  );
}

renderExample("Text Mark Attachments", <App />);

```

v0.2.2



### Truncation

`markdown` comes with a built-in truncation feature. Whether to add an ellipsis can be set through the `overflow` property. The default value is `ellipsis`, which means an ellipsis will be added. Setting it to `clip` means no ellipsis will be added. Tables do not support adding ellipses.

You can control the maximum number of text lines through the `text-maxline` property, and control the maximum text height through the `height` style. When both are present, they will take effect simultaneously.

**This is an example below: markdown**

**Bundle:** `dist/truncation.lynx.bundle` | Web: `dist/truncation.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { renderExample } from "../common.js";

function App() {
  const content = `
this is a **Markdown**!!

this is a **Markdown**!!

this is a **Markdown**!!
  `;

  return (
    <view className="plain-surface">
      <markdown
        id="markdown"
        content={content}
        text-maxline={2}
        style={{ height: "100px" }}
      />
    </view>
  );
}

renderExample("Truncation", <App />);

```

v0.2.2



#### Custom Truncation Text

By default, the truncation text is an ellipsis. To modify the truncation text, you need to configure it through `markdown-style`. `markdown-style` has a special tag `truncation` used to set the truncation text.

**This is an example below: markdown**

**Bundle:** `dist/truncation_text.lynx.bundle` | Web: `dist/truncation_text.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { renderExample } from "../common.js";
import type { MarkdownStyle } from "../intrinsic-element.js";

function App() {
  const content = `
this is a **Markdown**!!

this is a **Markdown**!!

this is a **Markdown**!!
  `;
  const style: MarkdownStyle = {
    truncation: {
      content: "...more",
    },
  };

  return (
    <view className="plain-surface">
      <markdown
        id="markdown"
        content={content}
        markdown-style={style}
        text-maxline={2}
        style="height:100px;"
      />
    </view>
  );
}

renderExample("Truncation Text", <App />);

```

v0.2.2



The above code sets the truncation text to "...more", which will be added at the end of the truncated text instead of an ellipsis.

#### Custom Truncation View

The truncation text can also be a Lynx View. You only need to set `truncationType` to `view` in `truncation` and set `content` to a view id. Similar to inlineview, the child view corresponding to `content` will replace the truncation text.

**This is an example below: markdown**

**Bundle:** `dist/truncation_view.lynx.bundle` | Web: `dist/truncation_view.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { renderExample } from "../common.js";
import type { MarkdownStyle } from "../intrinsic-element.js";

function App() {
  const content = `
this is a **Markdown**!!

this is a **Markdown**!!

this is a **Markdown**!!
  `;
  const style: MarkdownStyle = {
    truncation: {
      content: "truncation",
      truncationType: "view",
    },
  };

  return (
    <view className="plain-surface" style="height:100vh;position:relative;">
      <markdown
        id="markdown"
        content={content}
        markdown-style={style}
        text-maxline={2}
        style="height:100px;"
      >
        <view id="truncation" className="truncation-view">
          <text className="truncation-text">...expand</text>
        </view>
      </markdown>
    </view>
  );
}

renderExample("Truncation View", <App />);

```

v0.2.2



Using Lynx View as truncation text allows for more custom effects, such as listening to click events on the truncation text and expanding all content when clicked.

### Typewriter

Typewriter animations are very common in AI outputs. `markdown` directly supports typewriter animations. We can enable the typewriter animation by setting `animation-type` to `typewriter`. Meanwhile, we can set the speed of the typewriter animation using `animation-velocity`, with the unit being characters per second.

**This is an example below: markdown**

**Bundle:** `dist/typewriter.lynx.bundle` | Web: `dist/typewriter.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { renderExample } from "../common.js";

function App() {
  const content = `
this is a **Markdown**!!
`;

  return (
    <view className="plain-surface">
      <markdown
        content={content}
        animation-type="typewriter"
        animation-velocity={20}
      />
    </view>
  );
}

renderExample("Typewriter", <App />);

```

v0.2.2



#### Custom Cursor

By default, the typewriter cursor is an ellipsis. If you want to change the cursor, you can set it through `markdown-style`. `markdown-style` has a special tag for setting the typewriter cursor, which is `typewriterCursor`.

**This is an example below: markdown**

**Bundle:** `dist/typewriter_cursor.lynx.bundle` | Web: `dist/typewriter_cursor.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { renderExample } from "../common.js";
import type { MarkdownStyle } from "../intrinsic-element.js";

function App() {
  const content = `
this is a **Markdown**!!
`;
  const style: MarkdownStyle = {
    typewriterCursor: {
      customCursor: "cursor",
    },
  };

  return (
    <view className="plain-surface">
      <markdown
        content={content}
        markdown-style={style}
        animation-type="typewriter"
        animation-velocity={20}
      >
        <view id="cursor" className="cursor" flatten={false}></view>
      </markdown>
    </view>
  );
}

renderExample("Typewriter Cursor", <App />);

```

v0.2.2



In `typewriterCursor`, you can specify the cursor through `customCursor`. Similar to inlineview, the value of `customCursor` needs to be an id, and the child view with this id will replace the cursor during typing.

#### Keep the Cursor Visible

By default, the typewriter cursor will be hidden after the current content is output. However, in some cases, we may not want the cursor to be hidden until the content is complete. In this case, we can set `content-complete` to `false` to make the cursor always visible.

**This is an example below: markdown**

**Bundle:** `dist/typewriter_keep_cursor.lynx.bundle` | Web: `dist/typewriter_keep_cursor.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { renderExample } from "../common.js";
import type { MarkdownStyle } from "../intrinsic-element.js";

function App() {
  const content = `
this is a **Markdown**!!
`;
  const style: MarkdownStyle = {
    typewriterCursor: {
      customCursor: "cursor",
    },
  };

  return (
    <view className="plain-surface">
      <markdown
        content={content}
        markdown-style={style}
        animation-type="typewriter"
        animation-velocity={20}
        content-complete={false}
      >
        <view id="cursor" className="cursor" flatten={false}></view>
      </markdown>
    </view>
  );
}

renderExample("Typewriter Keep Cursor", <App />);

```

v0.2.2



#### Text Fade Effect

If you want the text to fade out at the end of the typing instead of using a cursor at the end, you can set `customCursor` in `typewriterCursor` to "none" to disable the cursor, and then use `markdown-effect` to set the fade effect of the text.

**This is an example below: markdown**

**Bundle:** `dist/typewriter_mask.lynx.bundle` | Web: `dist/typewriter_mask.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { useState } from "@lynx-js/react";

import { renderExample } from "../common.js";
import type { MarkdownEffect, MarkdownStyle } from "../intrinsic-element.js";

function App() {
  const content = `
this is a **Markdown**!!
`;
  const style: MarkdownStyle = {
    typewriterCursor: {
      customCursor: "none",
    },
  };
  const [effect, setEff] = useState<MarkdownEffect>({
    type: "text-mask",
    color: "linear-gradient(90deg, #ffffff00 0%, rgb(255, 255, 255) 100%)",
    rangeStart: -4,
    rangeEnd: -1,
  });

  return (
    <view className="plain-surface">
      <markdown
        content={content}
        markdown-style={style}
        animation-type="typewriter"
        animation-velocity={20}
        markdown-effect={effect}
        binddrawEnd={() => {
          setEff({});
        }}
      >
      </markdown>
    </view>
  );
}

renderExample("Typewriter Mask", <App />);

```

v0.2.2



In the above code, we added a text mask effect through `markdown-effect`. It will add a semi-transparent mask layer on the last 4 characters of the text.

Here we also listen to the `drawEnd` event, which is because `markdown-effect` will not be automatically removed after the typing is complete, but the `drawEnd` event will be triggered after the typing is complete, and in the callback of this event, we can clear `markdown-effect` to remove the fade effect of the text.

Like the cursor, when `content-complete` is set to `false`, the `drawEnd` event will not be triggered after the typing is complete. Therefore, the above code will remove the fade effect of the text after the content is complete **and** the typing is complete.

### Text Selection

#### Enable Selection

Set `text-selection={true}` to allow users to select text.

**This is an example below: markdown**

**Bundle:** `dist/text_selection.lynx.bundle` | Web: `dist/text_selection.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { renderExample } from "../common.js";

function App() {
  const content = `
this is a **Markdown**!!
`;

  return (
    <view className="plain-surface">
      <markdown
        content={content}
        text-selection={true}
        style="overflow:visible;"
      />
    </view>
  );
}

renderExample("Text Selection", <App />);

```

v0.2.2



Long-press the text to start a selection. Provide your own menu and actions; enabling selection does not add a clipboard menu.

#### Implement a Menu

`getTextBoundingRect` returns page coordinates. Subtract the containing view’s `boundingClientRect` coordinates before positioning an absolute menu inside it. This example displays the menu; the following examples add button actions.

When the selected area changes, the `selectionchange` event will be triggered, and the event parameters will contain the start position and end position of the selected area. If the current selected area is empty, both the start position and end position will be -1. We can use this to determine whether to display or hide the menu.

After displaying the menu, we need to adjust the position of the menu based on the selected area. We can use the `getTextBoundingRect` method to get the position of the selected area. This method needs to pass in the start position and end position of the selected area, and the return value is a `TextBoundingRect` object. The object contains the total bounding rect of the selected area and the bounding rect of each line of the selected area.

```ts
interface Rect {
  left: number;
  right: number;
  top: number;
  bottom: number;
  width: number;
  height: number;
}

interface TextBoundingRect {
  boundingRect: Rect;
  boxes: Rect[];
}
```

Use the total bounding rectangle to center the menu above the selection:

**This is an example below: markdown**

**Bundle:** `dist/selection_menu.lynx.bundle` | Web: `dist/selection_menu.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { useState } from "@lynx-js/react";

import type * as Lynx from "@lynx-js/types";
import { renderExample } from "../common.js";
import type { MarkdownTextBoundingRect } from "../intrinsic-element.js";
import { positionSelectionMenu } from "../selection.js";

function App() {
  const content = `
this is a **Markdown**!!

this is a **Markdown**!!

this is a **Markdown**!!
  `;
  const [menuVisible, setMenuVisible] = useState<"hidden" | "visible">(
    "hidden",
  );
  const [topOffset, setTopOffset] = useState(0);
  const [leftOffset, setLeftOffset] = useState(0);

  const onSelectionChange = (
    params: Lynx.BaseEvent<
      "bindselectionchange",
      { start: number; end: number }
    >,
  ) => {
    const start = params.detail.start;
    const end = params.detail.end;
    console.log("selection change: " + start + "," + end);
    if (start === -1) {
      setMenuVisible("hidden");
    } else {
      setMenuVisible("visible");
      lynx
        .createSelectorQuery()
        .select("#markdown")
        .invoke({
          method: "getTextBoundingRect",
          params: {
            start,
            end,
          },
          success(res: MarkdownTextBoundingRect) {
            console.log(res.boundingRect);
            positionSelectionMenu(res.boundingRect, setLeftOffset, setTopOffset);
          },
          fail(res) {
            console.log(res.code, res.data);
          },
        })
        .exec();
    }
  };

  return (
    <view id="selection-area" className="plain-surface selection-area">
      <markdown
        id="markdown"
        content={content}
        text-selection={true}
        bindselectionchange={onSelectionChange}
        style="overflow:visible;"
      />
      <view
        id="menu"
        className="selection-menu"
        style={{
          visibility: menuVisible,
          left: leftOffset + "px",
          top: topOffset + "px",
        }}
      >
        <view className="menu-inner">
          <text className="menu-button">Select</text>
          <view className="menu-divider" />
          <text className="menu-button">Copy</text>
        </view>
      </view>
    </view>
  );
}

renderExample("Selection Menu", <App />);

```

v0.2.2



#### Extend the Selection

`markdown` component provides a `setTextSelection` method to set the selected area from the front end. The parameters of the method are the starting touch position and the ending touch position of the selected area.

We listen to the click event of the "select all" text, and in the callback of the click event, we set the starting touch position to (0, 0) and the ending touch position to (MAX_VALUE, MAX_VALUE).

**This is an example below: markdown**

**Bundle:** `dist/selection_select_all.lynx.bundle` | Web: `dist/selection_select_all.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { useState } from "@lynx-js/react";

import type * as Lynx from "@lynx-js/types";
import { renderExample } from "../common.js";
import type { MarkdownTextBoundingRect } from "../intrinsic-element.js";
import { positionSelectionMenu } from "../selection.js";

function App() {
  const content = `
this is a **Markdown**!!

this is a **Markdown**!!

this is a **Markdown**!!
  `;
  const [menuVisible, setMenuVisible] = useState<"hidden" | "visible">(
    "hidden",
  );
  const [topOffset, setTopOffset] = useState(0);
  const [leftOffset, setLeftOffset] = useState(0);

  const onSelectionChange = (
    params: Lynx.BaseEvent<
      "bindselectionchange",
      { start: number; end: number }
    >,
  ) => {
    const start = params.detail.start;
    const end = params.detail.end;
    if (start === -1) {
      setMenuVisible("hidden");
      return;
    }

    setMenuVisible("visible");
    lynx
      .createSelectorQuery()
      .select("#markdown")
      .invoke({
        method: "getTextBoundingRect",
        params: {
          start,
          end,
        },
        success(res: MarkdownTextBoundingRect) {
          positionSelectionMenu(res.boundingRect, setLeftOffset, setTopOffset);
        },
      })
      .exec();
  };

  const onSelectAll = () => {
    lynx
      .createSelectorQuery()
      .select("#markdown")
      .invoke({
        method: "setTextSelection",
        params: {
          startX: 0,
          startY: 0,
          endX: Number.MAX_VALUE,
          endY: Number.MAX_VALUE,
        },
      })
      .exec();
  };

  return (
    <view id="selection-area" className="plain-surface selection-area">
      <markdown
        id="markdown"
        content={content}
        text-selection={true}
        bindselectionchange={onSelectionChange}
        style="overflow:visible;"
      />
      <view
        id="menu"
        className="selection-menu"
        style={{
          visibility: menuVisible,
          left: leftOffset + "px",
          top: topOffset + "px",
        }}
      >
        <view className="menu-inner">
          <text className="menu-button" bindtap={onSelectAll}>Select all</text>
          <view className="menu-divider" />
          <text className="menu-button">Copy</text>
        </view>
      </view>
    </view>
  );
}

renderExample("Selection Select All", <App />);

```

v0.2.2



#### Read Selected Text

Use `getSelectedText` to read plain text from the selection. The example displays the returned text when you tap `Get text`, then clears the selection and hides the menu. This method does not write to the system clipboard. To copy the text, call a Native Module provided by the host.

**This is an example below: markdown**

**Bundle:** `dist/selection_copy.lynx.bundle` | Web: `dist/selection_copy.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { useState } from "@lynx-js/react";

import type * as Lynx from "@lynx-js/types";
import { renderExample } from "../common.js";
import type { MarkdownTextBoundingRect } from "../intrinsic-element.js";
import { positionSelectionMenu } from "../selection.js";

function App() {
  const content = `
this is a **Markdown**!!

this is a **Markdown**!!

this is a **Markdown**!!
  `;
  const [menuVisible, setMenuVisible] = useState<"hidden" | "visible">(
    "hidden",
  );
  const [topOffset, setTopOffset] = useState(0);
  const [leftOffset, setLeftOffset] = useState(0);
  const [selectedText, setSelectedText] = useState("");

  const clearSelection = () => {
    lynx
      .createSelectorQuery()
      .select("#markdown")
      .invoke({
        method: "setTextSelection",
        params: {
          startX: -1,
          startY: -1,
          endX: -1,
          endY: -1,
        },
      })
      .exec();
  };

  const onSelectionChange = (
    params: Lynx.BaseEvent<
      "bindselectionchange",
      { start: number; end: number }
    >,
  ) => {
    const start = params.detail.start;
    const end = params.detail.end;
    if (start === -1) {
      setMenuVisible("hidden");
      return;
    }

    setMenuVisible("visible");
    lynx
      .createSelectorQuery()
      .select("#markdown")
      .invoke({
        method: "getTextBoundingRect",
        params: {
          start,
          end,
        },
        success(res: MarkdownTextBoundingRect) {
          positionSelectionMenu(res.boundingRect, setLeftOffset, setTopOffset);
        },
      })
      .exec();
  };

  const onSelectAll = () => {
    lynx.createSelectorQuery().select("#markdown").invoke({
      method: "setTextSelection",
      params: {
        startX: 0,
        startY: 0,
        endX: Number.MAX_VALUE,
        endY: Number.MAX_VALUE,
      },
    }).exec();
  };

  const onGetSelectedText = () => {
    lynx
      .createSelectorQuery()
      .select("#markdown")
      .invoke({
        method: "getSelectedText",
        success(res: { selectedText: string }) {
          console.log("selected text: " + res.selectedText);
          setSelectedText(res.selectedText);
          clearSelection();
          setMenuVisible("hidden");
        },
      })
      .exec();
  };

  return (
    <view id="selection-area" className="plain-surface selection-area">
      <markdown
        id="markdown"
        content={content}
        text-selection={true}
        bindselectionchange={onSelectionChange}
        style="overflow:visible;"
      />
      <view
        id="menu"
        className="selection-menu"
        style={{
          visibility: menuVisible,
          left: leftOffset + "px",
          top: topOffset + "px",
        }}
      >
        <view className="menu-inner">
          <text className="menu-button" bindtap={onSelectAll}>Select all</text>
          <view className="menu-divider" />
          <text className="menu-button" bindtap={onGetSelectedText}>Get text</text>
        </view>
      </view>
      {selectedText ? <text className="copied-text">Selected text: {selectedText}</text> : null}
    </view>
  );
}

renderExample("Selection Copy", <App />);

```

v0.2.2



#### Select a Paragraph or Sentence

`setTextSelection` takes coordinates relative to `<markdown>`. When selecting a paragraph from the center of a text bounding rectangle, subtract the markdown element’s page coordinates before passing equal start and end points.

By default, `markdown` only selects the character at the touch position when long pressed. If you want to select a paragraph or sentence, you need to adjust the selected area in the `selectionchange` event.

`setTextSelection` method also has a `selectionTextType` parameter. When the start and end positions are the same, this parameter will take effect. It is used to specify the type of selected text, which can be `char`, `word`, `sentence`, and `paragraph`.

By setting this parameter to `paragraph`, you can select a paragraph. Similarly, by setting this parameter to `sentence`, you can select a sentence.

**This is an example below: markdown**

**Bundle:** `dist/selection_paragraph.lynx.bundle` | Web: `dist/selection_paragraph.web.bundle`

```tsx
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import { useRef, useState } from "@lynx-js/react";

import type * as Lynx from "@lynx-js/types";
import { renderExample } from "../common.js";
import type { MarkdownTextBoundingRect } from "../intrinsic-element.js";
import { positionSelectionMenu } from "../selection.js";

function App() {
  const content = `
this is a **Markdown**!!

this is a **Markdown**!!

this is a **Markdown**!!
  `;
  const inSelection = useRef(false);
  const [menuVisible, setMenuVisible] = useState<"hidden" | "visible">(
    "hidden",
  );
  const [topOffset, setTopOffset] = useState(0);
  const [leftOffset, setLeftOffset] = useState(0);

  const onSelectionChange = (
    params: Lynx.BaseEvent<
      "bindselectionchange",
      { start: number; end: number }
    >,
  ) => {
    const start = params.detail.start;
    const end = params.detail.end;
    console.log("selection change: " + start + "," + end);
    if (start === -1) {
      setMenuVisible("hidden");
      inSelection.current = false;
      return;
    }

    const modifySelection = !inSelection.current;
    setMenuVisible("visible");
    lynx
      .createSelectorQuery()
      .select("#markdown")
      .invoke({
        method: "getTextBoundingRect",
        params: {
          start,
          end,
        },
        success(res: MarkdownTextBoundingRect) {
          console.log(res.boundingRect);
          if (modifySelection) {
            lynx.createSelectorQuery().select("#markdown").invoke({
              method: "boundingClientRect",
              success(markdownRect: MarkdownTextBoundingRect["boundingRect"]) {
                const x = res.boundingRect.left - markdownRect.left + res.boundingRect.width / 2;
                const y = res.boundingRect.top - markdownRect.top + res.boundingRect.height / 2;
                lynx.createSelectorQuery().select("#markdown").invoke({
                  method: "setTextSelection",
                  params: {
                    startX: x,
                    startY: y,
                    endX: x,
                    endY: y,
                    selectionTextType: "paragraph",
                  },
                }).exec();
              },
            }).exec();
          } else {
            positionSelectionMenu(res.boundingRect, setLeftOffset, setTopOffset);
          }
        },
        fail(res) {
          console.log(res.code, res.data);
        },
      })
      .exec();
    inSelection.current = true;
  };

  return (
    <view id="selection-area" className="plain-surface selection-area">
      <markdown
        id="markdown"
        content={content}
        text-selection={true}
        bindselectionchange={onSelectionChange}
        style="overflow:visible;"
      />
      <view
        id="menu"
        className="selection-menu"
        style={{
          visibility: menuVisible,
          left: leftOffset + "px",
          top: topOffset + "px",
        }}
      >
        <view className="menu-inner">
          <text className="menu-button">Select</text>
          <view className="menu-divider" />
          <text className="menu-button">Copy</text>
        </view>
      </view>
    </view>
  );
}

renderExample("Selection Paragraph", <App />);

```

v0.2.2



## Properties

The frontend can set the corresponding properties on the component to define the runtime behavior of the component, as shown below.

```tsx
<markdown content={content} />
```

### `content`

```ts
/**
 * markdown source content.
 */
content: string;
```

markdown content

### `content-id`

```ts
/**
 * mark the content when the event or UI method is triggered.
 */
'content-id'?: string;
```

Used as a unique identifier for `content`, for consumption in events.

### `markdown-style`

```ts
/**
 * set the style of markdown.
 * @defaultValue {}
 */
'markdown-style'?: object
```

markdown style, for specific formats please refer to [Stylesheets](#stylesheets)

### `animation-type`

```ts
/**
 * which animation to use.
 * none: no animation
 * typewriter: typewriter animation
 * @defaultValue 'none'
 */
'animation-type'?: 'none' | 'typewriter'
```

markdown animation style, optional typewriter effect

### `animation-velocity`

```ts
/**
 * velocity of animation.
 * when animation-type is typewriter, it's the number of characters typed per second.
 * @defaultValue 1
 */
'animation-velocity'?:number;
```

Speed of markdown typewriter effect

### `text-maxline`

```ts
/**
 * maximum number of text lines.
 * a table row is counted as a line
 */
'text-maxline'?: number;
```

maximum number of markdown text lines

### `overflow`

```ts
overflow?: 'ellipsis' | 'clip';
```

Choose an ellipsis or clipping when text overflows. Defaults to `ellipsis`.

### `initial-animation-step`

```ts
/**
 * animation will start at the given step.
 * @defaultValue 0
 */
'initial-animation-step'?: number
```

Specifies the start position of markdown animation

### `content-complete`

```ts
/**
 * whether to hide the typewriter cursor.
 * true: typewriter cursor will be hidden and drawEnd event will be triggered after the animation is complete.
 * false: typewriter cursor will be shown and drawEnd event will not be triggered.
 * @defaultValue true
 */
'content-complete'?: boolean;
```

Indicates if the current `content` is complete. If `true`, the cursor will be hidden after the animation ends, otherwise, the cursor remains visible

### `typewriter-dynamic-height`

```ts
/**
 * whether markdown height is equal to the content height typed by typewriter
 * @defaultValue false
 */
'typewriter-dynamic-height'?: boolean
```

Configures typewriter effect to dynamically change element height

### `text-selection`

```ts
/**
 * whether markdown content is selectable.
 * @defaultValue false
 */
'text-selection'?: boolean
```

Configures whether the markdown content is selectable

### `text-mark-attachments`

Used for complex highlighting: overlapping segments, line-wrapping, combined with underlines or strokes.

```ts
/**
 * define text mark attachments for highlighting or underlining character ranges.
 * attachments are drawn per line while preserving gradient continuity across lines.
 * @defaultValue []
 */
'text-mark-attachments'?: MarkAttachment[];

interface LineStyle {
  lineType: 'none' | 'solid' | 'dashed';
  color: string; // supports linear-gradient
  width: number; // px
  elementSize?: number; // dashed segment length
  emptySize?: number; // dashed gap length
}

interface MarkStyle {
  radius?: number; // corner radius
  left?: number;
  right?: number;
  top?: number;
  bottom?: number;
  color?: string; // fill color or gradient
  borderLeft?: LineStyle;
  borderTop?: LineStyle;
  borderRight?: LineStyle;
  borderBottom?: LineStyle;
}

interface MarkAttachment {
  startIndex: number;
  endIndex: number; // exclusive
  indexType: 'char' | 'source';
  clickable?: boolean;
  id?: string;
  layer?: 'background' | 'foreground';
  style: MarkStyle;
}
```

### `content-range`

```ts
/**
 * the range of content to be parsed.
 * @defaultValue [0, int32_max]
 */
'content-range'?: number[];
```

Configures the parsing range for markdown content

### `markdown-effect`

```ts
/**
 * additional effects
 * @defaultValue {}
 */
'markdown-effect'?: object
```

Configure additional rendering effects. A text mask uses `{ type: 'text-mask', color, rangeStart, rangeEnd }`; see [Text Fade Effect](#text-fade-effect).

### `typewriter-height-transition-duration`

```ts
/**
 * transition duration when height extended by typewriter animation.
 * @defaultValue 0
 */
'typewriter-height-transition-duration'?: number
```

Set the transition duration in seconds when typewriter content changes height. The default is `0`. Use with `typewriter-dynamic-height`.

### `enable-gif`

```ts
/**
 * whether to enable gif animation.
 * @defaultValue false
 */
'enable-gif'?: boolean
```

Configure whether to enable GIF animation on iOS. Android supports GIF animation by default.

## Events

The frontend can bind corresponding event callbacks on the component to monitor the runtime behavior of the component, as shown below.

```tsx
<markdown content={content} binddrawEnd={onDrawEnd} />
```

### `binddrawStart`

```ts
/**
 * draw start
 */
binddrawStart?: (e: BaseEvent) => void;
```

Event for markdown drawing start

### `binddrawEnd`

```ts
/**
 * draw end
 */
binddrawEnd?: (e: BaseEvent) => void;
```

Event for markdown drawing end

### `bindanimationStep`

```ts
export interface MarkdownAnimationStepEvent {
    /**
     * current step of animation.
     */
    animationStep: number;

    /**
     * maximum step of animation.
     */
    maxAnimationStep: number;
}

/**
 * callback after each animation frame, some animation steps may be skipped if animation velocity is too fast.
 */
bindanimationStep?: (e: BaseEvent<'bindanimationStep', MarkdownAnimationStepEvent>) => void;
```

Callback event for each markdown animation frame

### `bindoverflow`

```ts

export interface MarkdownOverflowEvent {
    /**
     * type of overflow.
     * ellipsis: overflow text will be replaced by ... or truncation view.
     * clip: overflow text will be clipped
     */
    type: 'ellipsis' | 'clip';
}

/**
 * callback when text overflow.
 */
bindoverflow?: (e: BaseEvent<'bindoverflow', MarkdownOverflowEvent>) => void;
```

Event for markdown text overflow

### `bindlink`

```ts
export interface MarkdownLinkEvent {
    /**
     * link url
     */
    url: string;

    /**
     * link text
     */
    content: string;
}

/**
 * callback when link is clicked.
 */
bindlink?: (e: BaseEvent<'bindlink', MarkdownLinkEvent>) => void;
```

Event for markdown link click

### `bindselectionchange`

```ts
export interface MarkdownSelectionChangeEvent {
    /**
     * start char pos of selection range.
     */
    start: number;
    /**
     * end char pos of selection range.
     */
    end: number;
    /**
     * direction of selection.
     */
    direction: 'forward' | 'backward';
}

/**
 * callback when selection change.
 */
bindselectionchange?: (e: BaseEvent<'bindselectionchange', MarkdownSelectionChangeEvent>) => void;
```

Event for markdown cursor change

### `bindimageTap`

```ts
export interface MarkdownImageTapEvent {
    /**
     * image url
     */
    url: string;
}

/**
 * callback when image is clicked.
 */
bindimageTap?: (e: BaseEvent<'bindimageTap', MarkdownImageTapEvent>) => void;
```

Event for markdown image click

### `bindparseEnd`

```ts
export interface MarkdownParseEndEvent {
    /**
     * the id of content that parsed.
     */
    id: string;
}

/**
 * callback when parse end.
 */
bindparseEnd?: (e: BaseEvent<'bindparseEnd', MarkdownParseEndEvent>) => void;
```

Event for markdown parsing end

### `bindtextClick`

Triggered when an attachment with `clickable` set in `text-mark-attachments` is clicked; the event returns the `id` of that attachment.

```ts
export interface MarkdownTextClickEvent {
  /** id of the clicked attachment */
  id: string;
}

/**
 * callback when a clickable attachment defined in `text-mark-attachments` is clicked.
 */
bindtextClick?: (e: BaseEvent<'bindtextClick', MarkdownTextClickEvent>) => void;
```

## Methods

The frontend can use the [SelectorQuery](/next/api/lynx-api/nodes-ref/nodes-ref-invoke.md) API to execute the component's methods, as shown below:

```ts title=index.js
lynx
  .createSelectorQuery() // create SelectorQuery
  .select('#markdown') // specify the target node's selector
  .invoke({
    // specify the operation for the target node
    method: 'pauseAnimation',
    success: function (res) {
      console.log(res);
    },
    fail: function (res) {
      console.log(res.code, res.data);
    },
  })
  .exec(); // execute query
```

### `pauseAnimation`

```ts
/**
 */
export interface MarkdownPauseAnimationMethod extends BaseMethod {
  method: 'pauseAnimation';
  success?: Callback<{
    /**
     * current step of animation.
     */
    animationStep: number;
  }>;
}
```

Pause animation

### `resumeAnimation`

```ts
/**
 */
export interface MarkdownResumeAnimationMethod extends BaseMethod {
  method: 'resumeAnimation';
  params?: {
    /**
     * animation will start at the given step.
     */
    animationStep?: number;
  };
}
```

Resume animation

### `getContent`

```ts
/**
 * get parsed content
 */
export interface MarkdownGetContentMethod extends BaseMethod {
  method: 'getContent';
  params: {
    /**
     * start index of parsed content.
     * @defaultValue 0
     */
    start?: number;
    /**
     * end index of parsed content.
     * @defaultValue int32_max
     */
    end?: number;
  };
  success?: Callback<{
    /**
     * parsed content of the given range.
     */
    content: string;
  }>;
}
```

Get parsed content

### `getSelectedText`

```ts
/**
 */
export interface MarkdownGetSelectedTextMethod extends BaseMethod {
  method: 'getSelectedText';
  success?: Callback<{
    /**
     * selected text.
     */
    selectedText: string;
  }>;
}
```

Get selected text

### `setTextSelection`

```ts
/**
 * Control text selection highlighting.
 */
export interface MarkdownSetTextSelectionMethod extends BaseMethod {
  method: 'setTextSelection';
  params: {
    /**
     * The x-coordinate of the start of the selected text relative to the text component
     */
    startX: number;
    /**
     * The y-coordinate of the start of the selected text relative to the text component
     */
    startY: number;
    /**
     * The x-coordinate of the end of the selected text relative to the text component
     */
    endX: number;
    /**
     * The y-coordinate of the end of the selected text relative to the text component
     */
    endY: number;
    selectionTextType?: 'char' | 'word' | 'sentence' | 'paragraph';
  };
  success?: Callback<{
    /**
     * The bounding box of the selected text
     */
    boundingRect: {
      left: number;
      top: number;
      right: number;
      bottom: number;
      width: number;
      height: number;
    };
    /**
     * The bounding boxes of each line
     */
    boxes: {
      left: number;
      top: number;
      right: number;
      bottom: number;
      width: number;
      height: number;
    }[];
    /**
     * The cursor positions and the default radius
     */
    handles?: {
      x: number;
      y: number;
      radius: number;
    }[];
  }>;
}
```

Set text selection box

### `getTextBoundingRect`

```ts
/**
 */
export interface MarkdownGetTextBoundingRectMethod extends BaseMethod {
  method: 'getTextBoundingRect';
  params: {
    /**
     * start index of parsed content.
     * @defaultValue 0
     */
    start?: number;
    /**
     * end index of parsed content.
     * @defaultValue int32_max
     */
    end?: number;
    /**
     * index type of the start and end.
     * @defaultValue 'char'
     */
    indexType?: 'source' | 'char';
  };
  success?: Callback<{
    /**
     * bounding rect of the given range.
     */
    boundingRect: {
      left: number;
      top: number;
      right: number;
      bottom: number;
      width: number;
      height: number;
    };
    /**
     * bounding boxes of each line.
     */
    boxes: {
      left: number;
      top: number;
      right: number;
      bottom: number;
      width: number;
      height: number;
    }[];
  }>;
}
```

Get bounding rect of the given range.

### `getImages`

```ts
/**
 * get all images in the markdown.
 */
export interface MarkdownGetImagesMethod extends BaseMethod {
  method: 'getImages';
  success?: Callback<{
    /**
     * all images in the markdown.
     */
    images: string[];
  }>;
}
```

Get all images in the markdown

### `getParseResult`

```ts
/**
 * get source ranges of the given tags.
 */
export interface MarkdownGetParseResultMethod extends BaseMethod {
  method: 'getParseResult';
  params: {
    /**
     * tags that you want to get its source range.
     */
    tags: string[];
  };
  success?: Callback<{
    /**
     * source ranges of the given tags.
     * key: tag
     * value: ranges
     */
    result: Record<
      string,
      {
        start: number;
        end: number;
      }[]
    >;
  }>;
}
```

Get parsing results for specified tags

## Stylesheets

### normalText - Normal Text Style

Supported properties:

- backgroundColor (color) - Background color
- color (color) - Text color
- direction (enum: normal, ltr, rtl) - Text direction
- font (font) - Font
- fontSize (float) - Font size
- fontWeight (enum: normal, bold, 100-900) - Font weight
- lastLineAlignment (enum: left, center, right, justify) - Last line alignment
- lineHeight (float) - Line height
- lineSpace (float) - Line spacing
- marginBottom (float) - Bottom margin
- marginLeft (float) - Left margin
- marginRight (float) - Right margin
- marginTop (float) - Top margin
- paddingBottom (float) - Bottom padding
- paddingLeft (float) - Left padding
- paddingRight (float) - Right padding
- paddingTop (float) - Top padding
- paragraphSpace (float) - Paragraph spacing
- textAlign (enum: left, center, right, justify) - Text alignment
- textIndent (float) - Text indent
- textMaxline (int) - Maximum lines
- textOverflow (enum: clip, ellipsis) - Text overflow
- wordBreak (enum: normal, break-all) - Word break

### h1 - Level 1 Heading Style

Supported properties:

- backgroundColor (color) - Background color
- color (color) - Text color
- direction (enum: normal, ltr, rtl) - Text direction
- font (font) - Font settings
- fontSize (float) - Font size
- fontWeight (enum: normal, bold, 100-900) - Font weight
- lastLineAlignment (enum: left, center, right, justify) - Last line alignment
- lineHeight (float) - Line height
- lineSpace (float) - Line spacing
- marginBottom (float) - Bottom margin
- marginLeft (float) - Left margin
- marginRight (float) - Right margin
- marginTop (float) - Top margin
- paddingBottom (float) - Bottom padding
- paddingLeft (float) - Left padding
- paddingRight (float) - Right padding
- paddingTop (float) - Top padding
- paragraphSpace (float) - Paragraph spacing
- textAlign (enum: left, center, right, justify) - Text alignment
- textIndent (float) - Text indent
- textMaxline (int) - Maximum lines
- textOverflow (enum: clip, ellipsis) - Text overflow handling
- wordBreak (enum: normal, break-all) - Word break

### h2 - Level 2 Heading Style

Supported properties:

- backgroundColor (color) - Background color
- color (color) - Text color
- direction (enum: normal, ltr, rtl) - Text direction
- font (font) - Font settings
- fontSize (float) - Font size
- fontWeight (enum: normal, bold, 100-900) - Font weight
- lastLineAlignment (enum: left, center, right, justify) - Last line alignment
- lineHeight (float) - Line height
- lineSpace (float) - Line spacing
- marginBottom (float) - Bottom margin
- marginLeft (float) - Left margin
- marginRight (float) - Right margin
- marginTop (float) - Top margin
- paddingBottom (float) - Bottom padding
- paddingLeft (float) - Left padding
- paddingRight (float) - Right padding
- paddingTop (float) - Top padding
- paragraphSpace (float) - Paragraph spacing
- textAlign (enum: left, center, right, justify) - Text alignment
- textIndent (float) - Text indent
- textMaxline (int) - Maximum lines
- textOverflow (enum: clip, ellipsis) - Text overflow handling
- wordBreak (enum: normal, break-all) - Word break

### h3 - Level 3 Heading Style

Supported properties:

- backgroundColor (color) - Background color
- color (color) - Text color
- direction (enum: normal, ltr, rtl) - Text direction
- font (font) - Font settings
- fontSize (float) - Font size
- fontWeight (enum: normal, bold, 100-900) - Font weight
- lastLineAlignment (enum: left, center, right, justify) - Last line alignment
- lineHeight (float) - Line height
- lineSpace (float) - Line spacing
- marginBottom (float) - Bottom margin
- marginLeft (float) - Left margin
- marginRight (float) - Right margin
- marginTop (float) - Top margin
- paddingBottom (float) - Bottom padding
- paddingLeft (float) - Left padding
- paddingRight (float) - Right padding
- paddingTop (float) - Top padding
- paragraphSpace (float) - Paragraph spacing
- textAlign (enum: left, center, right, justify) - Text alignment
- textIndent (float) - Text indent
- textMaxline (int) - Maximum lines
- textOverflow (enum: clip, ellipsis) - Text overflow handling
- wordBreak (enum: normal, break-all) - Word break

### h4 - Level 4 Heading Style

Supported properties:

- backgroundColor (color) - Background color
- color (color) - Text color
- direction (enum: normal, ltr, rtl) - Text direction
- font (font) - Font settings
- fontSize (float) - Font size
- fontWeight (enum: normal, bold, 100-900) - Font weight
- lastLineAlignment (enum: left, center, right, justify) - Last line alignment
- lineHeight (float) - Line height
- lineSpace (float) - Line spacing
- marginBottom (float) - Bottom margin
- marginLeft (float) - Left margin
- marginRight (float) - Right margin
- marginTop (float) - Top margin
- paddingBottom (float) - Bottom padding
- paddingLeft (float) - Left padding
- paddingRight (float) - Right padding
- paddingTop (float) - Top padding
- paragraphSpace (float) - Paragraph spacing
- textAlign (enum: left, center, right, justify) - Text alignment
- textIndent (float) - Text indent
- textMaxline (int) - Maximum lines
- textOverflow (enum: clip, ellipsis) - Text overflow handling
- wordBreak (enum: normal, break-all) - Word break

### h5 - Level 5 Heading Style

Supported properties:

- backgroundColor (color) - Background color
- color (color) - Text color
- direction (enum: normal, ltr, rtl) - Text direction
- font (font) - Font settings
- fontSize (float) - Font size
- fontWeight (enum: normal, bold, 100-900) - Font weight
- lastLineAlignment (enum: left, center, right, justify) - Last line alignment
- lineHeight (float) - Line height
- lineSpace (float) - Line spacing
- marginBottom (float) - Bottom margin
- marginLeft (float) - Left margin
- marginRight (float) - Right margin
- marginTop (float) - Top margin
- paddingBottom (float) - Bottom padding
- paddingLeft (float) - Left padding
- paddingRight (float) - Right padding
- paddingTop (float) - Top padding
- paragraphSpace (float) - Paragraph spacing
- textAlign (enum: left, center, right, justify) - Text alignment
- textIndent (float) - Text indent
- textMaxline (int) - Maximum lines
- textOverflow (enum: clip, ellipsis) - Text overflow handling
- wordBreak (enum: normal, break-all) - Word break

### h6 - Level 6 Heading Style

Supported properties:

- backgroundColor (color) - Background color
- color (color) - Text color
- direction (enum: normal, ltr, rtl) - Text direction
- font (font) - Font settings
- fontSize (float) - Font size
- fontWeight (enum: normal, bold, 100-900) - Font weight
- lastLineAlignment (enum: left, center, right, justify) - Last line alignment
- lineHeight (float) - Line height
- lineSpace (float) - Line spacing
- marginBottom (float) - Bottom margin
- marginLeft (float) - Left margin
- marginRight (float) - Right margin
- marginTop (float) - Top margin
- paddingBottom (float) - Bottom padding
- paddingLeft (float) - Left padding
- paddingRight (float) - Right padding
- paddingTop (float) - Top padding
- paragraphSpace (float) - Paragraph spacing
- textAlign (enum: left, center, right, justify) - Text alignment
- textIndent (float) - Text indent
- textMaxline (int) - Maximum lines
- textOverflow (enum: clip, ellipsis) - Text overflow handling
- wordBreak (enum: normal, break-all) - Word break

### link - Link Style

Supported properties:

- backgroundColor (color) - Background color
- color (color) - Text color
- font (font) - Font settings
- fontSize (float) - Font size
- fontWeight (enum: normal, bold, 100-900) - Font weight
- textDecorationColor (color) - Text decoration color
- textDecorationLine (enum: none, underline, overline, line-through) - Text decoration line
- textDecorationStyle (enum: none, solid, double, dotted, dashed, wavy) - Text decoration style
- textDecorationThickness (float) - Text decoration thickness

### inlineCode - Inline Code Style

Supported properties:

- backgroundColor (color) - Background color
- borderColor (color) - Border color
- borderRadius (float) - Border radius
- borderWidth (float) - Border width
- color (color) - Text color
- font (font) - Font settings
- fontSize (float) - Font size
- fontWeight (enum: normal, bold, 100-900) - Font weight
- marginLeft (float) - Left margin
- marginRight (float) - Right margin
- paddingLeft (float) - Left padding
- paddingRight (float) - Right padding

### codeBlock - Code Block Style

Supported properties:

- backgroundColor (color) - Background color
- borderColor (color) - Border color
- borderRadius (float) - Border radius
- borderType (enum: none, solid) - Border type
- borderWidth (float) - Border width
- color (color) - Text color
- direction (enum: normal, ltr, rtl) - Text direction
- font (font) - Font settings
- fontSize (float) - Font size
- fontWeight (enum: normal, bold, 100-900) - Font weight
- lastLineAlignment (enum: left, center, right, justify) - Last line alignment
- lineHeight (float) - Line height
- lineSpace (float) - Line spacing
- marginBottom (float) - Bottom margin
- marginLeft (float) - Left margin
- marginRight (float) - Right margin
- marginTop (float) - Top margin
- maxWidth (float) - Maximum width
- paddingBottom (float) - Bottom padding
- paddingLeft (float) - Left padding
- paddingRight (float) - Right padding
- paddingTop (float) - Top padding
- paragraphSpace (float) - Paragraph spacing
- scrollX (bool) - Horizontal scroll
- textAlign (enum: left, center, right, justify) - Text alignment
- textIndent (float) - Text indent
- textMaxline (int) - Maximum lines
- textOverflow (enum: clip, ellipsis) - Text overflow handling
- wordBreak (enum: normal, break-all) - Word break

### quote - Quote Style

Supported properties:

- backgroundColor (color) - Background color
- borderColor (color) - Border color
- borderRadius (float) - Border radius
- borderType (enum: none, solid) - Border type
- borderWidth (float) - Border width
- color (color) - Text color
- direction (enum: normal, ltr, rtl) - Text direction
- font (font) - Font settings
- fontSize (float) - Font size
- fontWeight (enum: normal, bold, 100-900) - Font weight
- indent (float) - Indent
- lastLineAlignment (enum: left, center, right, justify) - Last line alignment
- lineHeight (float) - Line height
- lineSpace (float) - Line spacing
- marginBottom (float) - Bottom margin
- marginLeft (float) - Left margin
- marginRight (float) - Right margin
- marginTop (float) - Top margin
- paddingBottom (float) - Bottom padding
- paddingLeft (float) - Left padding
- paddingRight (float) - Right padding
- paddingTop (float) - Top padding
- paragraphSpace (float) - Paragraph spacing
- textAlign (enum: left, center, right, justify) - Text alignment
- textIndent (float) - Text indent
- textMaxline (int) - Maximum lines
- textOverflow (enum: clip, ellipsis) - Text overflow handling
- wordBreak (enum: normal, break-all) - Word break

### orderedList - Ordered List Style

Supported properties:

- backgroundColor (color) - Background color
- color (color) - Text color
- direction (enum: normal, ltr, rtl) - Text direction
- font (font) - Font settings
- fontSize (float) - Font size
- fontWeight (enum: normal, bold, 100-900) - Font weight
- indent (float) - Indent
- lastLineAlignment (enum: left, center, right, justify) - Last line alignment
- lineHeight (float) - Line height
- lineSpace (float) - Line spacing
- marginBottom (float) - Bottom margin
- marginLeft (float) - Left margin
- marginRight (float) - Right margin
- marginTop (float) - Top margin
- numberColor (color) - Number color
- numberFont (font) - Number font
- numberFontSize (float) - Number font size
- numberMarginRight (float) - Number right margin
- numberType (enum: number, alphabet, roman-numerals, mixed) - Number type
- paddingBottom (float) - Bottom padding
- paddingLeft (float) - Left padding
- paddingRight (float) - Right padding
- paddingTop (float) - Top padding
- paragraphSpace (float) - Paragraph spacing
- textAlign (enum: left, center, right, justify) - Text alignment
- textIndent (float) - Text indent
- textMaxline (int) - Maximum lines
- textOverflow (enum: clip, ellipsis) - Text overflow handling
- wordBreak (enum: normal, break-all) - Word break

### unorderedList - Unordered List Style

Supported properties:

- backgroundColor (color) - Background color
- color (color) - Text color
- direction (enum: normal, ltr, rtl) - Text direction
- font (font) - Font settings
- fontSize (float) - Font size
- fontWeight (enum: normal, bold, 100-900) - Font weight
- indent (float) - Indent
- lastLineAlignment (enum: left, center, right, justify) - Last line alignment
- lineHeight (float) - Line height
- lineSpace (float) - Line spacing
- marginBottom (float) - Bottom margin
- marginLeft (float) - Left margin
- marginRight (float) - Right margin
- marginTop (float) - Top margin
- markColor (color) - Mark color
- markMarginRight (float) - Mark right margin
- markSize (float) - Mark size
- markType (enum: ring, circle, square, mixed) - Mark type
- paddingBottom (float) - Bottom padding
- paddingLeft (float) - Left padding
- paddingRight (float) - Right padding
- paddingTop (float) - Top padding
- paragraphSpace (float) - Paragraph spacing
- textAlign (enum: left, center, right, justify) - Text alignment
- textMaxline (int) - Maximum lines
- textOverflow (enum: clip, ellipsis) - Text overflow handling
- wordBreak (enum: normal, break-all) - Word break

### table - Table Style

Supported properties:

- altColor (color) - Alternative color
- backgroundColor (color) - Background color
- borderColor (color) - Border color
- borderRadius (float) - Border radius
- borderWidth (float) - Border width
- marginBottom (float) - Bottom margin
- marginLeft (float) - Left margin
- marginRight (float) - Right margin
- marginTop (float) - Top margin
- maxWidth (float) - Maximum width
- minWidth (float) - Minimum width
- paddingBottom (float) - Bottom padding
- paddingLeft (float) - Left padding
- paddingRight (float) - Right padding
- paddingTop (float) - Top padding
- scrollX (bool) - Horizontal scroll
- tableBackground (enum: none, solid, chess-board) - Table background
- tableBorder (enum: none, full-rect, underline) - Table border

### tableCell - Table Cell Style

Supported properties:

- backgroundColor (color) - Background color
- color (color) - Text color
- direction (enum: normal, ltr, rtl) - Text direction
- font (font) - Font settings
- fontSize (float) - Font size
- fontWeight (enum: normal, bold, 100-900) - Font weight
- lastLineAlignment (enum: left, center, right, justify) - Last line alignment
- lineHeight (float) - Line height
- lineSpace (float) - Line spacing
- marginBottom (float) - Bottom margin
- marginLeft (float) - Left margin
- marginRight (float) - Right margin
- marginTop (float) - Top margin
- maxWidth (float) - Maximum width
- paddingBottom (float) - Bottom padding
- paddingLeft (float) - Left padding
- paddingRight (float) - Right padding
- paddingTop (float) - Top padding
- textAlign (enum: left, center, right, justify) - Text alignment
- textIndent (float) - Text indent
- wordBreak (enum: normal, break-all) - Word break

### split - Divider Style

Supported properties:

- borderColor (color) - Color
- borderWidth (float) - Width
- marginBottom (float) - Bottom margin
- marginTop (float) - Top margin

### typewriterCursor - Typewriter Cursor Style

Supported properties:

- customCursor (string) - Custom cursor
- verticalAlign (enum: baseline, top, center, bottom) - Cursor vertical alignment

### truncation - Truncation Style

Supported properties:

- content (string) - Truncation content
- truncationType (enum: text, view) - Truncation type

### listItem - List Item Style

Supported properties:

- marginBottom (float) - Bottom margin
- marginTop (float) - Top margin
- paddingBottom (float) - Bottom padding
- paddingTop (float) - Top padding

### tableHeader - Table Header Style

Supported properties:

- backgroundColor (color) - Background color
- color (color) - Text color
- direction (enum: normal, ltr, rtl) - Text direction
- font (font) - Font settings
- fontSize (float) - Font size
- fontWeight (enum: normal, bold, 100-900) - Font weight
- lastLineAlignment (enum: left, center, right, justify) - Last line alignment
- lineHeight (float) - Line height
- lineSpace (float) - Line spacing
- paddingBottom (float) - Bottom padding
- paddingLeft (float) - Left padding
- paddingRight (float) - Right padding
- paddingTop (float) - Top padding
- paragraphSpace (float) - Paragraph spacing
- textAlign (enum: left, center, right, justify) - Text alignment
- textIndent (float) - Text indent
- textMaxline (int) - Maximum lines
- textOverflow (enum: clip, ellipsis) - Text overflow handling
- verticalAlign (enum: baseline, top, center, bottom) - Vertical alignment
- wordBreak (enum: normal, break-all) - Word break

### image - Image Style

Supported properties:

- altImage (string) - Alternative image
- enableAltText (bool) - Enable alternative text
- height (float) - Height
- width (float) - Width

### quoteBorderLine - Quote Border Line Style

Supported properties:

- color (color) - Text color
- lineType (enum: none, solid, dashed) - Line type
- radius (float) - Radius
- shrink (float) - Shrink
- width (float) - Width

### unorderedListMarker - Unordered List Marker Style

Supported properties:

- color (color) - Text color
- height (float) - Height
- marginBottom (float) - Bottom margin
- marginLeft (float) - Left margin
- marginRight (float) - Right margin
- marginTop (float) - Top margin
- markType (enum: ring, circle, square, mixed) - Mark type
- width (float) - Width

### \<span> - Span Style

Supported properties:

- backgroundColor (color) - Background color
- backgroundImage (string) - Background image
- borderColor (color) - Border color
- borderRadius (float) - Border radius
- borderWidth (float) - Border width
- color (color) - Text color
- direction (enum: normal, ltr, rtl) - Text direction
- font (font) - Font settings
- fontSize (float) - Font size
- fontWeight (enum: normal, bold, 100-900) - Font weight
- marginLeft (float) - Left margin
- marginRight (float) - Right margin
- paddingLeft (float) - Left padding
- paddingRight (float) - Right padding
- textDecorationColor (color) - Text decoration line color
- textDecorationLine (enum: none, underline, overline, line-through) - Text decoration line type
- textDecorationStyle (enum: none, solid, double, dotted, dashed, wavy) - Text decoration line style
- textDecorationThickness (float) - Text decoration line width

### \<p> - Paragraph Style

Supported properties:

- direction (enum: normal, ltr, rtl) - Text direction
- lastLineAlignment (enum: left, center, right, justify) - Last line alignment
- lineHeight (float) - Line height
- lineSpace (float) - Line spacing
- marginBottom (float) - Bottom margin
- marginTop (float) - Top margin
- paddingBottom (float) - Bottom padding
- paddingTop (float) - Top padding
- paragraphSpace (float) - Paragraph spacing
- textAlign (enum: left, center, right, justify) - Text alignment
- textIndent (float) - Text indent
- textMaxline (int) - Maximum lines
- textOverflow (enum: clip, ellipsis) - Text overflow handling
- wordBreak (enum: normal, break-all) - Word break

### orderedListNumber - Ordered List Number Style

Supported properties:

- backgroundColor (color) - Background color
- color (color) - Text color
- font (font) - Font settings
- fontSize (float) - Font size
- fontWeight (enum: normal, bold, 100-900) - Font weight
- lineHeight (float) - Line height
- marginBottom (float) - Bottom margin
- marginLeft (float) - Left margin
- marginRight (float) - Right margin
- marginTop (float) - Top margin

### imageCaption - Image Caption Style

Supported properties:

- captionPosition (enum: top, bottom) - Caption position
- color (color) - Text color
- direction (enum: normal, ltr, rtl) - Text direction
- font (font) - Font settings
- fontSize (float) - Font size
- fontWeight (enum: normal, bold, 100-900) - Font weight
- lineHeight (float) - Line height
- textAlign (enum: left, center, right, justify) - Text alignment

## Compatibility

**Compatibility Table**

**Query:** `elements.markdown`

[Source](https://github.com/lynx-family/lynx-website/tree/main/packages/lynx-compat-data/elements/markdown.json)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| markdown | Yes (2.15) | Yes (3.1) | Yes (2.16) | Yes (2.18) | Yes (2.18) | Partial |
| allow-break-around-punctuation | Yes (3.2) | Yes (4.0) | Yes (3.2) | Yes (4.0) | Yes (4.0) | No |
| animation-frame-rate | Yes (3.2) | No | Yes (3.2) | Yes (4.0) | Yes (4.0) | No |
| animation-type | Yes (2.15) | Yes (3.1) | Yes (2.16) | Yes (2.18) | Yes (2.18) | Yes |
| animation-velocity | Yes (2.15) | Yes (3.1) | Yes (2.16) | Yes (2.18) | Yes (2.18) | Yes |
| content | Yes (2.15) | Yes (3.1) | Yes (2.16) | Yes (2.18) | Yes (2.18) | Yes |
| content-complete | Yes (2.17) | No | Yes (3.1) | Yes (4.0) | Yes (4.0) | Yes |
| content-id | Yes (3.1) | No | Yes (3.2) | Yes (4.0) | Yes (4.0) | Yes |
| content-range | Yes (2.18) | Yes (3.1) | Yes (3.1) | Yes (4.0) | Yes (4.0) | Yes |
| enable-break-around-punctuation | No | Yes (4.0) | No | No | No | No |
| enable-selection | No | Yes (4.0) | No | No | No | No |
| initial-animation-step | Yes (2.17) | Yes (3.1) | Yes (2.18) | Yes (4.0) | Yes (4.0) | Yes |
| markdown-effect | Yes (3.1) | No | Yes (3.2) | Yes (4.0) | Yes (4.0) | Yes |
| markdown-style | Yes (2.15) | Yes (3.1) | Yes (2.16) | Yes (2.18) | Yes (2.18) | Yes |
| text-maxline | Yes (2.15) | Yes (3.1) | Yes (2.16) | Yes (2.18) | Yes (2.18) | Yes |
| text-selection | Yes (2.17) | Yes (3.1) | Yes (2.18) | Yes (4.0) | Yes (4.0) | Yes |
| typewriter-dynamic-height | Yes (2.17) | No | Yes (2.18) | Yes (4.0) | Yes (4.0) | Yes |
| typewriter-height-transition-duration | Yes (3.2) | No | Yes (3.2) | Yes (4.0) | Yes (4.0) | Yes |
| bindanimationStep | Yes (2.17) | No | Yes (2.18) | Yes (4.0) | Yes (4.0) | No |
| binddrawEnd | Yes (2.15) | No | Yes (2.16) | Yes (2.18) | Yes (2.18) | No |
| binddrawStart | Yes (2.15) | No | Yes (2.16) | Yes (2.18) | Yes (2.18) | No |
| bindimageTap | Yes (3.1) | No | Yes (3.2) | Yes (4.0) | Yes (4.0) | No |
| bindlink | Yes (2.15) | No | Yes (2.16) | Yes (2.18) | Yes (2.18) | No |
| bindoverflow | Yes (2.16) | No | Yes (4.0) | Yes (2.18) | Yes (2.18) | No |
| bindparseEnd | Yes (3.1) | No | Yes (3.2) | Yes (4.0) | Yes (4.0) | No |
| bindselectionchange | Yes (2.17) | No | Yes (3.1) | Yes (4.0) | Yes (4.0) | No |
| getCharIndexByPoint | Yes (4.0) | No | Yes (4.0) | No | No | No |
| getContent | Yes (2.17) | Yes (3.1) | Yes (2.18) | Yes (4.0) | Yes (4.0) | Yes |
| getImages | Yes (3.1) | No | Yes (3.2) | Yes (4.0) | Yes (4.0) | Yes |
| getParseResult | Yes (3.1) | Yes (4.0) | Yes (3.2) | Yes (4.0) | Yes (4.0) | Yes |
| getSelectedText | Yes (2.17) | Yes (3.1) | Yes (2.18) | Yes (4.0) | Yes (4.0) | Yes |
| pauseAnimation | Yes (2.17) | No | Yes (3.1) | Yes (4.0) | Yes (4.0) | Yes |
| resumeAnimation | Yes (2.17) | No | Yes (3.1) | Yes (4.0) | Yes (4.0) | Yes |
| setTextSelection | Yes (2.17) | Yes (3.1) | Yes (2.18) | Yes (4.0) | Yes (4.0) | Yes |
| boundingClientRect | Yes (2.15) | Yes (2.16) | Yes (1.0) | Yes (4.0) | Yes (4.0) | Yes |
| requestAccessibilityFocus | Yes (2.15) | No | Yes (2.18) | No | No | No |
| scrollIntoView | Yes (2.15) | Yes (2.17) | Yes (2.18) | Yes (4.0) | Yes (4.0) | Yes |

**`markdown`**

markdown

- **Web — Supported (version unknown):** Partial support; Alternate name: `x-markdown`; Requires the opt-in <code>@lynx-js/web-elements/XMarkdown</code> import and the <code>x-markdown</code> tag. Native Markdown attributes and events are only partially implemented.

**`allow-break-around-punctuation`**

<code>allow-break-around-punctuation</code>

**`animation-frame-rate`**

<code>animation-frame-rate</code>

**`animation-type`**

<code>animation-type</code>

**`animation-velocity`**

<code>animation-velocity</code>

**`content`**

<code>content</code>

**`content-complete`**

<code>content-complete</code>

**`content-id`**

<code>content-id</code>

**`content-range`**

<code>content-range</code>

**`enable-break-around-punctuation`**

<code>enable-break-around-punctuation</code>

**`enable-selection`**

<code>enable-selection</code>

**`initial-animation-step`**

<code>initial-animation-step</code>

**`markdown-effect`**

<code>markdown-effect</code>

**`markdown-style`**

<code>markdown-style</code>

**`text-maxline`**

<code>text-maxline</code>

**`text-selection`**

<code>text-selection</code>

**`typewriter-dynamic-height`**

<code>typewriter-dynamic-height</code>

**`typewriter-height-transition-duration`**

<code>typewriter-height-transition-duration</code>

**`bindanimationStep`**

<code>bindanimationStep</code>

- **Web — Not supported:** The Web component emits DOM events with a bind prefix; native Lynx event bindings are not implemented for these events.

**`binddrawEnd`**

<code>binddrawEnd</code>

- **Web — Not supported:** The Web component emits DOM events with a bind prefix; native Lynx event bindings are not implemented for these events.

**`binddrawStart`**

<code>binddrawStart</code>

- **Web — Not supported:** The Web component emits DOM events with a bind prefix; native Lynx event bindings are not implemented for these events.

**`bindimageTap`**

<code>bindimageTap</code>

- **Web — Not supported:** The Web component emits DOM events with a bind prefix; native Lynx event bindings are not implemented for these events.

**`bindlink`**

<code>bindlink</code>

- **Web — Not supported:** The Web component emits DOM events with a bind prefix; native Lynx event bindings are not implemented for these events.

**`bindoverflow`**

<code>bindoverflow</code>

- **Web — Not supported:** The Web component emits DOM events with a bind prefix; native Lynx event bindings are not implemented for these events.

**`bindparseEnd`**

<code>bindparseEnd</code>

- **Web — Not supported:** The Web component emits DOM events with a bind prefix; native Lynx event bindings are not implemented for these events.

**`bindselectionchange`**

<code>bindselectionchange</code>

- **Web — Not supported:** The Web component emits DOM events with a bind prefix; native Lynx event bindings are not implemented for these events.

**`getCharIndexByPoint`**

<code>getCharIndexByPoint</code>

**`getContent`**

<code>getContent</code>

**`getImages`**

<code>getImages</code>

**`getParseResult`**

<code>getParseResult</code>

**`getSelectedText`**

<code>getSelectedText</code>

**`pauseAnimation`**

<code>pauseAnimation</code>

**`resumeAnimation`**

<code>resumeAnimation</code>

**`setTextSelection`**

<code>setTextSelection</code>

**`boundingClientRect`**

<code>boundingClientRect</code>

**`requestAccessibilityFocus`**

<code>requestAccessibilityFocus</code>

**`scrollIntoView`**

<code>scrollIntoView</code>

