From 1d005239cbe30bac643d7471c6bae5166dc75c8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20So=C3=B3s?= Date: Mon, 15 Jul 2024 19:06:29 +0200 Subject: [PATCH] Allow alert classnames in HTML sanitization. (#3820) * Allow alert classnames in HTML sanitization. * Updated dartdoc_options.yaml * No -dev in version. * Update CHANGELOG.md Co-authored-by: Luka S --------- Co-authored-by: Luka S --- CHANGELOG.md | 4 ++++ dartdoc_options.yaml | 2 +- lib/src/render/documentation_renderer.dart | 5 ++++- lib/src/version.dart | 2 +- pubspec.yaml | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21de8249c5..0c833389a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 8.0.12 + + * Allow `markdown-alert` class names in HTML sanitization. (#3820) + ## 8.0.11 * Fix the slash key (`/`) not focusing the search box. (#3810) diff --git a/dartdoc_options.yaml b/dartdoc_options.yaml index 184f16408f..5afa418146 100644 --- a/dartdoc_options.yaml +++ b/dartdoc_options.yaml @@ -1,4 +1,4 @@ dartdoc: linkToSource: root: '.' - uriTemplate: 'https://github.com/dart-lang/dartdoc/blob/v8.0.11/%f%#L%l%' + uriTemplate: 'https://github.com/dart-lang/dartdoc/blob/v8.0.12/%f%#L%l%' diff --git a/lib/src/render/documentation_renderer.dart b/lib/src/render/documentation_renderer.dart index 0205aa9f6f..6b814c90cd 100644 --- a/lib/src/render/documentation_renderer.dart +++ b/lib/src/render/documentation_renderer.dart @@ -77,7 +77,10 @@ class DocumentationRenderResult { } bool _allowClassName(String className) => - className == 'deprecated' || className.startsWith('language-'); + className == 'deprecated' || + className.startsWith('language-') || + className == 'markdown-alert' || + className.startsWith('markdown-alert-'); Iterable _addLinkRel(String uriString) { final uri = Uri.tryParse(uriString); diff --git a/lib/src/version.dart b/lib/src/version.dart index 86f8591bd4..c175110e68 100644 --- a/lib/src/version.dart +++ b/lib/src/version.dart @@ -1 +1 @@ -const packageVersion = '8.0.11'; +const packageVersion = '8.0.12'; diff --git a/pubspec.yaml b/pubspec.yaml index f47e733e11..ff7f45ed10 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: dartdoc -version: 8.0.11 +version: 8.0.12 description: A non-interactive HTML documentation generator for Dart source code. repository: https://github.com/dart-lang/dartdoc