mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 08:28:11 +00:00
LibWebView: Create a method to syntax-highlight page source with HTML
This tokenizes a page's source to produce HTML with syntax highlighting. The first implementation here is rather simple; we do not yet implement code folding, line numbers, etc. The goal is for this to be used as the View Source implementation for all Ladybird chromes.
This commit is contained in:
parent
fea440055a
commit
1e1c3e5a34
4 changed files with 157 additions and 1 deletions
16
Userland/Libraries/LibWebView/SourceHighlighter.h
Normal file
16
Userland/Libraries/LibWebView/SourceHighlighter.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <AK/StringView.h>
|
||||
|
||||
namespace WebView {
|
||||
|
||||
String highlight_source(URL const&, StringView);
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue