File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const REGEX_PATTERN_FUNC = "(?<func>func)"
1212# Regex pattern to find method calls (e.g. "draw(...)")
1313const REGEX_PATTERN_METHOD_CALL = "(?<method_name>\\ w[\\ w\\ d]*)(?<method_args>\\ (.*?\\ ))"
1414# Regex pattern for numbers (with no special characters on either side)
15- const REGEX_PATTERN_NUMBER = "(?<number>[^# \\ [ \\ ] \\ (\\ )]?[0-9]++ \\ .?[0-9][^# \\ [ \\ ] \\ ( \\ )] ?)"
15+ const REGEX_PATTERN_NUMBER = "(?<number>\\ d+ (\\ . \\ d+) ?)"
1616const REGEX_SYMBOL = "(?<symbol>[a-zA-Z][a-zA-Z0-9_]+)"
1717
1818
@@ -62,6 +62,8 @@ static func bbcode_add_code_color(bbcode_text := "") -> String:
6262 colored_string += replaced .substr (current_index , last_closing_bracket_index )
6363 current_index = last_closing_bracket_index
6464
65+ if colored_string == "" :
66+ colored_string = match_string
6567 colored_string = "[code]" + colored_string + "[/code]"
6668 bbcode_text .erase (index_offset , initial_length )
6769 bbcode_text = bbcode_text .insert (index_offset , colored_string )
You can’t perform that action at this time.
0 commit comments