MCPcopy Create free account
hub / github.com/cogentcore/core / stringformat

Function stringformat

parse/languages/bibtex/bibtex.go:250–263  ·  view source on GitHub ↗

stringformat determines the correct formatting verb for the given BibTeX field value.

(v string)

Source from the content-addressed store, hash-verified

248
249// stringformat determines the correct formatting verb for the given BibTeX field value.
250func stringformat(v string) string {
251 // Numbers may be represented unquoted.
252 if _, err := strconv.Atoi(v); err == nil {
253 return "%s"
254 }
255
256 // Strings with certain characters must be brace quoted.
257 if strings.ContainsAny(v, "\"{}") {
258 return "{%s}"
259 }
260
261 // Default to quoted string.
262 return "%q"
263}
264
265// MakeKeyMap creates the KeyMap from CiteName to entry
266func (bib *BibTex) MakeKeyMap() {

Callers 1

PrettyStringMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected