adf

package
v0.19.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package adf inspects Atlassian Document Format (ADF) JSON without importing Jira types, so store, origin, and CLI can share it without crossing the store/jira firewall (docs/ARCHITECTURE.md).

PlainText flattens a document for FTS. IsSimple is the format-loss gate (doc / paragraph / text / hardBreak, no marks) ported from web/src/lib/adf.ts isSimpleAdf; FormatLoss names what a plain-text replace would destroy, for the refusal that prints it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatLoss added in v0.19.0

func FormatLoss(raw string) []string

FormatLoss lists what a plain-text replace of raw would destroy: node types outside the IsSimple set, plus mark names (strong, link, …), deduped in first-appearance order — edit -m's refusal prints them so the user sees what the replace would drop (GDK-1001). Empty means a plain-text replace loses nothing. A bare string (the older wiki-markup shape PlainText passes through) is already plain. A document that does not parse is reported, never waved through.

func IsSimple added in v0.17.0

func IsSimple(raw string) bool

IsSimple is the Go port of web/src/lib/adf.ts isSimpleAdf: empty/null is simple; otherwise only doc/paragraph/text/hardBreak with no marks. A plain-text replace of a non-simple document would drop formatting, so callers refuse unless the user passed force.

func PlainText

func PlainText(raw json.RawMessage) string

PlainText flattens an ADF document to plain text: it is what FTS indexes and what makes a repro-steps custom field searchable. A field that holds a bare string (the older wiki-markup shape) passes through unchanged.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL