> ## Documentation Index
> Fetch the complete documentation index at: https://mint-tsdocs.saulo.engineer/llms.txt
> Use this file to discover all available pages before exploring further.

# writePlainText

> Writes plain text with context-aware formatting

export const RefLink = ({target, children}) => {
  if (!target || typeof target !== 'string') {
    console.error('RefLink: Invalid target prop. Expected non-empty string.');
    return <span className="tsdocs-reflink broken-link" title="Invalid RefLink target" data-component="tsdocs-reflink">Invalid Link</span>;
  }
  const linkText = children || target;
  const path = typeof window !== 'undefined' && window.getRefPath ? window.getRefPath(target) : `./${target.split('.').filter(s => s.length > 0).join('/')}`;
  const isValid = typeof window !== 'undefined' && window.VALID_REFS && window.VALID_REFS.has(target);
  const className = !isValid ? 'tsdocs-reflink broken-link' : 'tsdocs-reflink';
  const title = !isValid ? `Broken API reference: ${target}` : undefined;
  return <a href={path} className={className} title={title} data-component="tsdocs-reflink">
      {linkText}
    </a>;
};

export const PageLink = ({target, children}) => {
  if (!target || typeof target !== 'string') {
    console.error('PageLink: Invalid target prop. Expected non-empty string.');
    return <span className="tsdocs-pagelink broken-link" title="Invalid PageLink target" data-component="tsdocs-pagelink">Invalid Link</span>;
  }
  const linkText = children || target;
  let path = target;
  if (!path.startsWith('/')) {
    path = `/${target}`;
  }
  const isValid = typeof window !== 'undefined' && window.VALID_PAGES && window.VALID_PAGES.has(target);
  const className = !isValid ? 'tsdocs-pagelink broken-link' : 'tsdocs-pagelink';
  const title = !isValid ? `Broken page link: ${target}` : undefined;
  return <a href={path} className={className} title={title} data-component="tsdocs-pagelink">
      {linkText}
    </a>;
};

# writePlainText

## Summary

Writes plain text with context-aware formatting

## Signature

```typescript theme={null}
protected writePlainText(text: string, context: IMarkdownEmitterContext): void;
```

## Parameters

### text

**Type**:`string`

The text to write

### context

**Type**:<RefLink target="mint-tsdocs.IMarkdownEmitterContext">`IMarkdownEmitterContext`</RefLink>

Emission context (includes bold/italic state)

## Returns

**Type**:`void`

Writes plain text with context-aware formatting

## Remarks

This method handles the complex logic of inserting markdown formatting markers (bold `**`, italic `_`) while avoiding ambiguous sequences.  **Processing steps:** 1. Split text into \[leading whitespace, content, trailing whitespace] 2. Write leading whitespace as-is 3. Check if a separator is needed before formatting markers 4. Apply bold/italic markers if requested 5. Write escaped content 6. Close bold/italic markers 7. Write trailing whitespace as-is  **Separator logic:** When transitioning between formatted spans (e.g., `**bold***italic*`), we need a zero-width separator to prevent parser ambiguity. The separator is inserted unless the previous character is safe (empty, newline, space, `[`, or `>`).
