fields

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 3 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 fields holds the small normalization helpers that source connectors share. Each helper has at least two connector call sites.

Index

Constants

This section is empty.

Variables

View Source
var HTMLTagRe = htmlTagRe

HTMLTagRe matches HTML tags. Connectors that need custom replacement text use it directly; otherwise use StripHTMLTags.

Functions

func CompactSpace

func CompactSpace(value string) string

CompactSpace collapses runs of whitespace into one space.

func DOIURL

func DOIURL(doi string) string

DOIURL returns the doi.org URL for a DOI.

func FirstNonEmpty

func FirstNonEmpty(values ...string) string

FirstNonEmpty returns the first value that is not blank.

func JSONScalarString

func JSONScalarString(raw json.RawMessage) string

JSONScalarString decodes a JSON string or number into a trimmed string.

func NonEmptyStrings

func NonEmptyStrings(values ...string) []string

NonEmptyStrings returns the trimmed values that are not empty.

func NormalizeArXivID

func NormalizeArXivID(value string) string

NormalizeArXivID trims whitespace, an abs URL prefix and a version suffix.

func NormalizeDOI

func NormalizeDOI(value string) string

NormalizeDOI lowercases a DOI and removes a URL or "doi:" prefix.

func StripHTMLTags

func StripHTMLTags(s string) string

StripHTMLTags removes HTML tags from s and collapses whitespace.

Types

This section is empty.

Jump to

Keyboard shortcuts

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