{"id":13561343,"url":"https://github.com/lexbor/lexbor","last_synced_at":"2025-05-14T09:08:55.303Z","repository":{"id":37502636,"uuid":"122375902","full_name":"lexbor/lexbor","owner":"lexbor","description":"Lexbor is development of an open source HTML Renderer library. https://lexbor.com","archived":false,"fork":false,"pushed_at":"2025-03-18T17:01:07.000Z","size":11631,"stargazers_count":1746,"open_issues_count":34,"forks_count":111,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-04-05T00:01:33.172Z","etag":null,"topics":["c","fast","html"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lexbor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://boosty.to/lexbor"]}},"created_at":"2018-02-21T18:28:52.000Z","updated_at":"2025-04-04T18:09:31.000Z","dependencies_parsed_at":"2024-03-17T14:24:31.177Z","dependency_job_id":"5419a465-c8fa-472b-b973-f31860d97b9b","html_url":"https://github.com/lexbor/lexbor","commit_stats":{"total_commits":598,"total_committers":28,"mean_commits":"21.357142857142858","dds":"0.13210702341137126","last_synced_commit":"d090c29d489751e70962c8cf2c25db89722d5313"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexbor%2Flexbor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexbor%2Flexbor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexbor%2Flexbor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexbor%2Flexbor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lexbor","download_url":"https://codeload.github.com/lexbor/lexbor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248509886,"owners_count":21116125,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","fast","html"],"created_at":"2024-08-01T13:00:55.128Z","updated_at":"2025-04-12T02:54:28.232Z","avatar_url":"https://github.com/lexbor.png","language":"C","readme":"## Lexbor: Crafting a Browser Engine with Simplicity and Flexibility\n\nWhy build yet another browser engine?\nThere's a myriad of challenges developers face in fully utilizing modern web technologies.\nParsing HTML and CSS, dealing with URLs and encodings often involves slow, resource-heavy implementations or outdated solutions.\nEven established solutions, written in C++ and reaching tens of megabytes in volume, are often not versatile enough.\nMeanwhile, language-specific implementations for Python, Node.js, Rust, or any other favorite of the day are slow and prone to lock-in.\n\n\n### The Core Requirements\n\nLexbor's core requirements rose from the ashes of these challenges:\n\n#### Portability\n\nLexbor aims to adapt to different platforms and integrate into various programming languages.\nIt's not yet another library full of quirks and idiosyncrasies;\nLexbor aims to offer developers flexibility to incorporate it into their work directly, regardless of the programming language they chose.\n\n#### Modularity\n\nLexbor wants to keep things simple: Developers should be able to use only the parts they need.\nWhether it's an HTML or URL parser, the engine's code should be straightforward and easy to navigate, promoting rapid development.\n\n#### Speed\n\nIn a nutshell, Lexbor wants things to happen *real fast*.\nIt's not just about making a browser engine; it's about making sure that *everything*,\neven the most resource-intensive tasks such as HTML parsing, occur swiftly to meet the real-time demands of modern web applications.\n\n#### Independence\n\nLexbor empowers developers by giving them full control over algorithms, resources, and dimensions.\nBy eliminating  on external dependencies, we let developers customize the engine without sacrificing performance or features.\n\n#### Compliance\n\nLexbor commits to industry standards.\nDevelopers need to be sure that the code aligns with widely established specifications.\nThe output of Lexbor's modules, be it HTML, CSS, URLs, or others, should match that of modern browsers, meeting industry specifications.\n\n\n### Origin Story\n\nHaving had all these goals in mind for about a decade, Alexander Borisov,\nwhose name gave the project its title,\ncame up with the idea of a browser engine crafted entirely in C\n(there's no school like the old school).\nThe language was chosen simply because we believed it could meet all the criteria seamlessly.\n\nUnlike heavyweights such as WebKit or Blink, Lexbor takes a lean and focused approach,\ndelivering a nimble yet powerful browser engine.\nAll it takes is years of top-notch developer expertise.\n\nAn important point to make: Lexbor doesn't stop at parsing and rendering modern HTML.\nIt offers each component as a standalone entity, ready to be integrated into other people's projects.\nThis approach sets us apart, providing a modular solution that not only meets browser needs\nbut also empowers developers with versatile tools for their own web-related tasks.\n\nAll in all, we envision Lexbor a promising player in the menagerie of browser technologies,\npushing the boundaries and helping developers fully leverage modern web technologies.\n\n\n## Features\n\n* [Modules](https://github.com/lexbor/lexbor/tree/master/source/lexbor).\n* [Single or separate](https://github.com/lexbor/lexbor#single-or-separately) libraries for each module.\n* No outside dependencies.\n* Easy to port to any platform.\n* C99 support.\n* Speed.\n\n### HTML Module\n\n* Full conformance with the [HTML5 specification](https://html.spec.whatwg.org/multipage/).\n* Manipulation of [elements](https://github.com/lexbor/lexbor/blob/master/examples/lexbor/html/element_create.c) and [attributes](https://github.com/lexbor/lexbor/blob/master/examples/lexbor/html/element_attributes.c): add, change, delete and other.\n* Supports fragment parsing (for [innerHTML](https://github.com/lexbor/lexbor/blob/master/examples/lexbor/html/element_innerHTML.c)).\n* Supports parsing [by chunks](https://github.com/lexbor/lexbor/blob/master/examples/lexbor/html/document_parse_chunk.c).\n* Passes all tree construction tests.\n* [Tested](https://github.com/lexbor/warc_test) by 200+ million HTML pages with [ASAN](https://clang.llvm.org/docs/AddressSanitizer.html).\n* Two way for parsing HTML: [by Document](https://github.com/lexbor/lexbor/blob/master/examples/lexbor/html/document_parse.c), [by Parser](https://github.com/lexbor/lexbor/blob/master/examples/lexbor/html/parse.c).\n* Supports [determining encoding](https://github.com/lexbor/lexbor/blob/master/examples/lexbor/html/encoding.c) by byte stream.\n* [Parsing CSS Styles](https://github.com/lexbor/lexbor/tree/master/examples/lexbor/styles) in tag attributes and in the `\u003cstyle\u003e` tag.\n* Fast\n\n### CSS Module\n\n* Full conformance with the [CSS Syntax](https://drafts.csswg.org/css-syntax-3/) module.\n* Supports:\n* * [x] [Selectors](https://github.com/lexbor/lexbor/tree/master/examples/lexbor/selectors).\n* * [x] [StyleSheet Tree](https://github.com/lexbor/lexbor/tree/master/examples/lexbor/css) (aka CSSOM).\n* * [x] and so on.\n* Fast.\n\n### Selectors Module\n\n* Search for HTML elements using CSS selectors.\n* Fast.\n\n### Encoding Module\n\n* Full conformance with the [Encoding specification](https://encoding.spec.whatwg.org/).\n* Supports `40 encodings` for encode/decode.\n* Supports [single](https://github.com/lexbor/lexbor/blob/master/examples/lexbor/encoding/single/from_to.c) and [buffering](https://github.com/lexbor/lexbor/blob/master/examples/lexbor/encoding/buffer/from_to.c) encode/decode.\n* Fast.\n\n### URL Module\n\n* Conformance with the [URL specification](https://url.spec.whatwg.org/)\n* Support [Unicode ToASCII](https://www.unicode.org/reports/tr46/#ToASCII)\n* Fast.\n\n### Punycode Module\n\n* Conformance with the [Punycode specification](https://www.rfc-editor.org/rfc/inline-errata/rfc3492.html).\n* Support Encode/Decode.\n\n### Unicode Module\n\n* Unicode Standard Annex [#15](https://www.unicode.org/reports/tr15/).\n* * Support Unicode normalization forms: D (NFD), C (NFC), KD (NFKD), KC (NFKC).\n* * Support chunks (stream).\n* Unicode Technical Standard [#46](https://unicode.org/reports/tr46/).\n* * Support Unicode [IDNA Processing](https://www.unicode.org/reports/tr46/#Processing).\n* * Support Unicode [ToASCII](https://www.unicode.org/reports/tr46/#ToASCII).\n* * Support Unicode [ToUnicode](https://www.unicode.org/reports/tr46/#ToUnicode).\n* Fast.\n\n### Development of modules in process\n\n* Layout\n* Font\n* and so on\n\n## Build and Installation\n\n### Binary packages\n\nBinaries are available for:\n\n* [CentOS](https://lexbor.com/download/#centos) 6, 7, 8\n* [Debian](https://lexbor.com/download/#debian) 8, 9, 10, 11\n* [Fedora](https://lexbor.com/download/#fedora) 28, 29, 30, 31, 32, 33, 34, 36, 37\n* [RHEL](https://lexbor.com/download/#rhel) 7, 8\n* [Ubuntu](https://lexbor.com/download/#ubuntu) 14.04, 16.04, 18.04, 18.10, 19.04, 19.10, 20.04, 20.10, 21.04, 22.04\n\nCurrently for `x86_64` architecture.\nIf you need any other architecture, please, write to [support@lexbor.com](mailto:support@lexbor.com).\n\n### vcpkg\n\nFor vcpkg users there is a `lexbor` [port](https://github.com/microsoft/vcpkg/tree/master/ports/lexbor) that can be installed via `vcpkg install lexbor` or by adding it to `dependencies` section of your `vcpkg.json` file.\n\n### macOS\n\n#### Homebrew\n\nTo install `lexbor` on macOS from Homebrew:\n\n```sh\nbrew install lexbor\n```\n\n#### MacPorts\n\nTo install `lexbor` on macOS from MacPorts:\n\n```sh\nsudo port install lexbor\n```\n\n### Source code\n\nFor building and installing Lexbor library from source code, use [CMake](https://cmake.org/) (open-source, cross-platform build system).\n\n```bash\ncmake . -DLEXBOR_BUILD_TESTS=ON -DLEXBOR_BUILD_EXAMPLES=ON\nmake\nmake test\n```\n\nPlease, see more information in [documentation](https://lexbor.com/docs/lexbor/#source_code).\n\n## Single or separately\n\n### Single\n* liblexbor — this is a single library that includes all modules.\n\n### Separately\n* liblexbor-{module name} — libraries for each module.\n\nYou only need an HTML parser? Use `liblexbor-html`.\n\nSeparate modules may depend on each other.\nFor example, dependencies for `liblexbor-html`: `liblexbor-core`, `liblexbor-dom`, `liblexbor-tag`, `liblexbor-ns`.\n\nThe `liblexbor-html` library already contains all the pointers to the required dependencies. Just include it in the assembly: `gcc program.c -llexbor-html`.\n\n## External Bindings and Wrappers\n\n* [Elixir](https://git.pleroma.social/pleroma/elixir-libraries/fast_html) binding for the HTML module (since 2.0 version)\n* [Crystal](https://github.com/kostya/lexbor) Fast HTML5 Parser with CSS selectors for Crystal language\n* [Python](https://github.com/rushter/selectolax#available-backends) binding for modest and lexbor engines.\n* [D](https://github.com/trikko/parserino) Fast HTML5 Parser with CSS selectors for D programming language\n* [Ruby](https://github.com/serpapi/nokolexbor) Fast HTML5 Parser with both CSS selectors and XPath support.\n* [PHP](https://github.com/php/php-src)'s DOM extension uses Lexbor's HTML living standard parser and CSS selector support, starting from PHP 8.4.\n* [Julia](https://github.com/MichaelHatherly/Lexbor.jl) binding for the HTML module.\n\nYou can create a binding or wrapper for the `lexbor` and place the link here!\n\n## Documentation\n\nAvailable on [lexbor.com](https://lexbor.com) in [Documentation](https://lexbor.com/documentation/) section.\n\n## Roadmap\n\nPlease, see [roadmap](https://lexbor.com/roadmap/) on [lexbor.com](https://lexbor.com).\n\n## Getting Help\n\n* E-mail [support@lexbor.com](mailto:support@lexbor.com)\n\n## SAST Tools\n\n[PVS-Studio](https://pvs-studio.com/en/pvs-studio/?utm_source=website\u0026utm_medium=github\u0026utm_campaign=open_source) - static analyzer for C, C++, C#, and Java code.\n\n## AUTHOR\n\nAlexander Borisov \u003cborisov@lexbor.com\u003e\n\n## COPYRIGHT AND LICENSE\n\n   Lexbor.\n\n   Copyright 2018-2024 Alexander Borisov\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n\n\nPlease, see [LICENSE](https://github.com/lexbor/lexbor/blob/master/LICENSE) file.\n","funding_links":["https://boosty.to/lexbor"],"categories":["C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flexbor%2Flexbor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flexbor%2Flexbor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flexbor%2Flexbor/lists"}