Skip to main content
Glama
adf.ts1.16 kB
/** * Atlassian Document Format (ADF) Utility Functions * * This module provides utility functions for working with Atlassian Document Format, * which is the structured format required for rich text fields in Jira like descriptions * and comments. These utilities handle conversion between plain text and ADF format. */ import type { ADFDocument } from '../types/atlassianDocument.types' /** * Converts a plain text string to an Atlassian Document Format (ADF) document * * @param text The plain text to convert to ADF * @returns An ADF document object */ export function convertToADF(text: string): ADFDocument { // Split the text by new lines to create separate paragraphs const paragraphs = text.split(/\n\r?|\r\n?/).filter(Boolean) return { version: 1, type: 'doc', content: paragraphs.length > 0 ? paragraphs.map((paragraph) => ({ type: 'paragraph', content: [ { type: 'text', text: paragraph, }, ], })) : [ { type: 'paragraph', content: [ { type: 'text', text: text || '', }, ], }, ], } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tbreeding/jira-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server