mirror of
https://github.com/Relintai/godot-engine.file-editor.git
synced 2025-04-25 19:54:58 +02:00
32 lines
700 B
GDScript
32 lines
700 B
GDScript
tool
|
|
extends WindowDialog
|
|
|
|
onready var TextPreview = $Container/TextPreview
|
|
|
|
func _ready():
|
|
pass
|
|
|
|
func print_preview(content : String):
|
|
TextPreview.append_bbcode(content)
|
|
|
|
func print_bb(content : String):
|
|
TextPreview.append_bbcode(content)
|
|
|
|
func print_markdown(content : String):
|
|
content = content.replace(" **"," [b]")
|
|
content = content.replace("**","[/b]")
|
|
|
|
content = content.replace(" *"," [i]")
|
|
content = content.replace("*","[/i] ")
|
|
|
|
content = content.replace(" ~~","[s] ")
|
|
content = content.replace("~~","[/s]")
|
|
|
|
content = content.replace(" `"," [code]")
|
|
content = content.replace("`","[/code]")
|
|
|
|
TextPreview.append_bbcode(content)
|
|
|
|
func _on_Preview_popup_hide():
|
|
queue_free()
|