forked from sunglocto/lambda
initial commit
This commit is contained in:
19
gtk-xmpp-markup.go
Normal file
19
gtk-xmpp-markup.go
Normal file
@@ -0,0 +1,19 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user