text

package
v0.0.0-...-598a1f7 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package text performs text manipulation on html strings it is used by projects and comments

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertLinks(s string) string

ConvertLinks returns the text with various transformations applied - bare links are turned into anchor tags, and @refs are turned into user links. this is somewhat fragile, better to parse the html

func ConvertNewlines

func ConvertNewlines(s string) string

ConvertNewlines converts \n to paragraph tags if the text already contains paragraph tags, return unaltered

func GetLinks(s string) bool

GetLinks checks the http status codes for the URLs in the string returns true if status code is within acceptable range or no urls was found returns false if status code is not withFing acceptable range

func GetUsernames

func GetUsernames(s string) []string

GetUsernames checks the text for usernames and returns them if found

Types

This section is empty.

Jump to

Keyboard shortcuts

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