1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Merge pull request #78312 from Calinou/editor-add-markdown-highlighting

Add Markdown syntax highlighting to the script editor
This commit is contained in:
Thaddeus Crews
2024-10-24 13:23:02 -05:00
2 changed files with 68 additions and 0 deletions

View File

@@ -120,6 +120,24 @@ public:
EditorJSONSyntaxHighlighter() { highlighter.instantiate(); }
};
class EditorMarkdownSyntaxHighlighter : public EditorSyntaxHighlighter {
GDCLASS(EditorMarkdownSyntaxHighlighter, EditorSyntaxHighlighter)
private:
Ref<CodeHighlighter> highlighter;
public:
virtual void _update_cache() override;
virtual Dictionary _get_line_syntax_highlighting_impl(int p_line) override { return highlighter->get_line_syntax_highlighting(p_line); }
virtual PackedStringArray _get_supported_languages() const override { return PackedStringArray{ "md", "markdown" }; }
virtual String _get_name() const override { return TTR("Markdown"); }
virtual Ref<EditorSyntaxHighlighter> _create() const override;
EditorMarkdownSyntaxHighlighter() { highlighter.instantiate(); }
};
///////////////////////////////////////////////////////////////////////////////
class ScriptEditorQuickOpen : public ConfirmationDialog {