Files
lambda/gtk-xmpp-markup.go

19 lines
610 B
Go
Raw Permalink Normal View History

2026-01-30 15:56:58 +00:00
package main
import (
_ "regexp"
)
// This file implements XEP-0393 partially by providing a function to get a Pango string.
// https://xmpp.org/extensions/xep-0393.html
func convertXEPToPango(text string) string {
/* FIXME this RegEx causes certain strings to appear invisible
text = regexp.MustCompile(`\*([^*]+)\*`).ReplaceAllString(text, "<b>$1</b>")
text = regexp.MustCompile(`_([^_]+)_`).ReplaceAllString(text, "<i>$1</i>")
text = regexp.MustCompile(`~([^~]+)~`).ReplaceAllString(text, "<s>$1</s>")
text = regexp.MustCompile("`([^`]+)`").ReplaceAllString(text, "<tt>$1</tt>")
*/
return text
}