diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2021-05-20 23:17:30 +0430 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-20 22:06:45 +0200 |
commit | dc388297ebe661908f4da549dab2c57697a7414b (patch) | |
tree | 65752507d48206dff5e125255a1ee144f594defe /Userland/Applications/Browser/Tab.cpp | |
parent | 97a230e4efedf92879da89cce57ffcb8d26fa517 (diff) | |
download | serenity-dc388297ebe661908f4da549dab2c57697a7414b.zip |
TextEditor+Browser: Enable HTML syntax highlighting on HTML documents
Diffstat (limited to 'Userland/Applications/Browser/Tab.cpp')
-rw-r--r-- | Userland/Applications/Browser/Tab.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Applications/Browser/Tab.cpp b/Userland/Applications/Browser/Tab.cpp index 2af6c42ed6..e7e05682e5 100644 --- a/Userland/Applications/Browser/Tab.cpp +++ b/Userland/Applications/Browser/Tab.cpp @@ -25,6 +25,7 @@ #include <LibGUI/ToolbarContainer.h> #include <LibGUI/Window.h> #include <LibJS/Interpreter.h> +#include <LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.h> #include <LibWeb/InProcessWebView.h> #include <LibWeb/Layout/BlockBox.h> #include <LibWeb/Layout/InitialContainingBlockBox.h> @@ -69,6 +70,7 @@ void Tab::view_source(const URL& url, const String& source) auto& editor = window->set_main_widget<GUI::TextEditor>(); editor.set_text(source); editor.set_mode(GUI::TextEditor::ReadOnly); + editor.set_syntax_highlighter(make<Web::HTML::SyntaxHighlighter>()); editor.set_ruler_visible(true); window->resize(640, 480); window->set_title(url.to_string()); |