diff --git a/CHANGELOG.md b/CHANGELOG.md index e53205666f..182aa154a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Added + +- Added `@generated` marker comment to HTML and SVG exports + ## [14.2.0] - 2025-10-09 ### Changed diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 4b04786b9c..04b444757c 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -60,6 +60,7 @@ The following people have contributed to the development of Rich: - [Felipe Guedes](https://github.com/guedesfelipe) - [Min RK](https://github.com/minrk) - [Clément Robert](https://github.com/neutrinoceros) +- [Jack Rosenthal](https://github.com/jackrosenthal) - [Brian Rutledge](https://github.com/bhrutledge) - [Tushar Sadhwani](https://github.com/tusharsadhwani) - [Luca Salvarani](https://github.com/LukeSavefrogs) diff --git a/rich/_export_format.py b/rich/_export_format.py index e7527e52f6..4556bb552c 100644 --- a/rich/_export_format.py +++ b/rich/_export_format.py @@ -1,5 +1,6 @@ CONSOLE_HTML_FORMAT = """\ + @@ -19,7 +20,7 @@ CONSOLE_SVG_FORMAT = """\ - + \n\n\n\n\n
foo <script> 'test' Click\n
\n\n\n' + expected = '\n\n\n\n\n\n\n\n
foo <script> 'test' Click\n
\n\n\n' assert html == expected @@ -524,11 +524,11 @@ def test_export_html_inline() -> None: console.print("[b]foo [link=https://example.org]Click[/link]") html = console.export_html(inline_styles=True) print(repr(html)) - expected = '\n\n\n\n\n\n\n
foo Click\n
\n\n\n' + expected = '\n\n\n\n\n\n\n\n
foo Click\n
\n\n\n' assert html == expected -EXPECTED_SVG = '\n \n \n\n \n \n \n \n \n \n\n Rich\n \n \n \n \n \n \n \n \n \n fooClick\n\n \n \n\n' +EXPECTED_SVG = '\n \n \n\n \n \n \n \n \n \n\n Rich\n \n \n \n \n \n \n \n \n \n fooClick\n\n \n \n\n' def test_export_svg() -> None: @@ -577,7 +577,7 @@ def test_save_text() -> None: def test_save_html() -> None: - expected = '\n\n\n\n\n\n\n
foo\n
\n\n\n' + expected = '\n\n\n\n\n\n\n\n
foo\n
\n\n\n' console = Console(record=True, width=100) console.print("foo") with tempfile.TemporaryDirectory() as path: