# Troubleshooting Guide

Common issues and solutions.

## Nested Links Not Working

**Problem**: Links inside links are not parsed.

**Explanation**: Per markdown spec, links cannot contain other links.

**Solution**: Use different markdown structure or custom extension.

## Line Breaks Not Working

**Problem**: Single newlines don't create `<br>` tags.

**Solution**: Enable `breaks` option or use two spaces before newline.

```javascript { .api }
marked.setOptions({ gfm: true, breaks: true });
```

## HTML Not Rendering

**Problem**: HTML in markdown is escaped or not showing.

**Solution**: Marked passes HTML through by default. To sanitize, use DOMPurify.

## Tables Not Working

**Problem**: Pipe-delimited tables not parsing.

**Solution**: Ensure `gfm: true` is enabled.

```javascript { .api }
marked.setOptions({ gfm: true });
```

## Extension Not Working

**Problem**: Custom extension not being applied.

**Solution**: Ensure tokenizer returns token object (not null/false) and includes `raw` property.

## Async Not Working

**Problem**: Async walkTokens or hooks not executing.

**Solution**: Set `async: true` and use `await`.

```javascript { .api }
marked.use({ async: true, walkTokens: async (token) => { await operation(); } });
const html = await marked.parse(markdown, { async: true });
```

## Performance Issues

**Problem**: Parsing is slow for large documents.

**Solutions**:
- Implement caching for repeated content
- Profile extensions to find bottlenecks
- Avoid expensive operations in walkTokens
