Compare commits

...

2 Commits

Author SHA1 Message Date
f6cae08b10 0.1.2 2024-11-15 18:24:42 -06:00
901b01ac61 newline fix 2024-11-15 18:19:04 -06:00
3 changed files with 8 additions and 4 deletions

View File

@ -7,3 +7,7 @@ initial release
- fix \[lb], \[rb], and \[text between brackets] - fix \[lb], \[rb], and \[text between brackets]
- add img tag support & stripping - add img tag support & stripping
- fix message logging - fix message logging
0.1.2
----
- fix newline handling

View File

@ -121,7 +121,7 @@ func parse_bbcode_text(text: String) -> BBCodeTag:
if not tag_matcher: if not tag_matcher:
tag_matcher = RegEx.new() tag_matcher = RegEx.new()
tag_matcher.compile("(.*?)(\\[(\\w+)([^\\[\\]]*?)\\]|\\[/(\\w+)\\])") tag_matcher.compile("(?s)(.*?)(\\[(\\w+)([^\\[\\]]*?)\\]|\\[/(\\w+)\\])")
var linear_matches: Array = tag_matcher.search_all(text) var linear_matches: Array = tag_matcher.search_all(text)
# no tags - plaintext # no tags - plaintext
@ -265,6 +265,7 @@ static func find_in_strings(bbcode: BBCodeTag, find: String) -> bool:
func test(): func test():
var tests := [ var tests := [
"Choose how the lobby operates.\n[color=#6a4420]PUBLIC[/color]: Public and visible in the Game Browser for all to join.\n[color=#6a4420]CODE-ONLY[/color]: Public, but not visible in the Game Browser, while still allowing players to join via.\n[color=#6a4420]FRIENDS-ONLY[/color]: Codeless Lobby that is hidden and inaccessible to all players except Steam friends.\n[color=#6a4420]OFFLINE/SOLO[/color]: Start a game alone, with players unable to join you.",
"[haha i am very cool]", "[haha i am very cool]",
"[b]foo[img=500]test1[/img]bar[img]test2[i]a[/i][/img][/b]", "[b]foo[img=500]test1[/img]bar[img]test2[i]a[/i][/img][/b]",
"foo [lb]bar[rb]", "foo [lb]bar[rb]",

View File

@ -19,11 +19,10 @@ func set_hlogmsg(val): pass
func _enter_tree(): func _enter_tree():
NetManager = NetManager_t.new() NetManager = NetManager_t.new()
BBCode = BBCode_t.new() BBCode = BBCode_t.new()
#NetManager.DEBUG = true
#BBCode.DEBUG = true
func _ready(): func _ready():
print("[LUCYSLIB] LucysLib 0.1.1 ready") print("[LUCYSLIB] LucysLib 0.1.2 ready")
#BBCode.DEBUG = true
#BBCode.test() #BBCode.test()
#func packet_dump(PACKET): #func packet_dump(PACKET):