Default components / Inline text

Underline

Renders the supported HTML underline tag as an underlined inline span.

UnderLineMdinline component

What it renders

Live Flutter preview

Starting the Flutter widget

Rendering this component with gpt_markdown…

This is the real GptMarkdown Flutter widget, rendered with the exact Markdown input shown here.

Markdown input

input.md
1Keep <u>this phrase</u> visible.

Default behavior

Runtime behavior

The component accepts the u HTML tag and renders its contained text with an underline.

Accessibility note

Avoid underlining plain text that is not a link; it can be mistaken for navigation.

Theming & styling

Theme layering guide

No dedicated style object

This built-in is an inline or structural text transformation. It inherits the surrounding text style; replace its syntax only when that behavior itself must change.

App-wide or scoped theme

theme.dart
1// This component has no dedicated style object. 2// It inherits the text style of the surrounding GptMarkdown widget. 3GptMarkdown( 4 markdown, 5 style: Theme.of(context).textTheme.bodyMedium, 6)

Builders & callbacks

This component has no component-specific builder or callback. Its appearance follows the surrounding text and theme, keeping the default parser behavior intact.
Full builder and callback signatures

Safely override the default

A custom component list replaces a default list entirely. Put your matching component first, then append the package defaults so every other Markdown feature continues to render.

keep_defaults.dart
1// Passing inlineComponents replaces its defaults. Prepend to override matching syntax, 2// then keep every built-in component after it. 3GptMarkdown( 4 markdown, 5 inlineComponents: [ 6 MyUnderLineMdOverride(), 7 ...MarkdownComponent.inlineComponents, 8 ], 9)
Custom component guide

Related components