editorial

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package editorial projects selected editorial content and validates proposed replacements. It has no model client, transport, database or actor identity.

Index

Constants

View Source
const SharingPolicy = "reviewed-editorial-v1"

SharingPolicy identifies the reviewed-editorial-content policy in audit receipts. It is not a claim that free text or aggregate data is anonymous.

Variables

View Source
var (
	ErrSource  = errors.New("unsupported editorial source")
	ErrInput   = errors.New("invalid editorial input")
	ErrPrivacy = errors.New("private editorial text")
	Reserved   = regexp.MustCompile(`(?i)RC_DRAFT_VALUE_|reputecast\.invalid`)
	Marker     = regexp.MustCompile(`<!--\s*rc:[a-zA-Z0-9_-]+\s*-->`)
)
View Source
var Liquid = regexp.MustCompile(`(?s)\{\{.*?\}\}|\{%.*?%\}`)
View Source
var URL = regexp.MustCompile(`(?i)(?:[a-z][a-z0-9+.-]*://|www\.|mailto:|tel:|data:)[^\s<>"']+`)

These detectors reject recognizable private records. They do not establish anonymity of arbitrary prose; people must review selected editorial sources and acknowledge residual risk before sharing. Confirmation never bypasses these checks or authorizes contact-record tools.

Functions

func Chat

func Chat(text string) string

Chat names the private record a chat message holds: "email", "phone" or "credential", or "" for none.

func Sample

func Sample(src string) (string, bool)

Sample reads visible text from supported MJML blocks, not attributes, comments, images or compliance footers. It preserves unexpanded tokens.

func SavedPolicy

func SavedPolicy(source string) mjml.GeneratedPolicy

SavedPolicy snapshots capabilities only after restoration and validation.

func Text

func Text(text string) (string, bool)

Text withholds recognized private records and replaces visible URLs. Detection normalizes encoding, but returned Liquid remains verbatim.

Types

type Binding

type Binding struct {
	Handle, Value, Kind string
}

type Email

type Email struct {
	Subject, Preheader, MJML string
}

type EmailContext

type EmailContext struct {
	Head, Header, Footer string
	Bindings             []Binding
	BindingPrefix        string
	Tokens               []string
	FinalPolicy          mjml.GeneratedPolicy
}

EmailContext stays on the instance. Only Source may leave it. Persist the context with its immutable proposal rather than rebuilding capabilities from model output at acceptance time.

func (*EmailContext) Project

func (c *EmailContext) Project(source string, links []string, before *Email, maxChars int) (Source, error)

Project keeps brand markup, URLs and token literals local. It returns visible editorial text with capabilities that are opaque to the model.

func (EmailContext) Restore

func (c EmailContext) Restore(email *Email, before *Email) error

Restore validates opaque capabilities before substituting their local values. It never grants a new URL, attribute, Liquid token or executable block. The original compliance and brand sections are restored last.

type Source

type Source struct {
	Source, Subject, Preheader string
	Links, Images, Tokens      []string
}

Jump to

Keyboard shortcuts

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