Skip to content

Commit 8df5061

Browse files
committed
Allow customizing HTML attributes for alert title
1 parent 41586dd commit 8df5061

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
66
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html),
77
with the exception that 0.x versions can break between minor versions.
88

9+
## [Unreleased]
10+
### Added
11+
- Allow customizing HTML attributes for alert title `<p>` tag via `AttributeProvider`
12+
913
## [0.28.0] - 2026-03-31
1014
### Added
1115
- New extension for alerts (aka callouts/admonitions)
@@ -533,6 +537,7 @@ API breaking changes (caused by changes in spec):
533537
Initial release of commonmark-java, a port of commonmark.js with extensions
534538
for autolinking URLs, GitHub flavored strikethrough and tables.
535539
540+
[Unreleased]: https://github.com/commonmark/commonmark-java/compare/commonmark-parent-0.28.0...main
536541
[0.28.0]: https://github.com/commonmark/commonmark-java/compare/commonmark-parent-0.27.1...commonmark-parent-0.28.0
537542
[0.27.1]: https://github.com/commonmark/commonmark-java/compare/commonmark-parent-0.27.0...commonmark-parent-0.27.1
538543
[0.27.0]: https://github.com/commonmark/commonmark-java/compare/commonmark-parent-0.26.0...commonmark-parent-0.27.0

commonmark-ext-gfm-alerts/src/main/java/org/commonmark/ext/gfm/alerts/internal/AlertHtmlNodeRenderer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected void renderAlert(Alert alert) {
3434
htmlWriter.line();
3535

3636
// Render alert title
37-
htmlWriter.tag("p", Map.of("class", "markdown-alert-title"));
37+
htmlWriter.tag("p", context.extendAttributes(alert, "p", Map.of("class", "markdown-alert-title")));
3838
htmlWriter.text(getAlertTitle(type));
3939
htmlWriter.tag("/p");
4040
htmlWriter.line();

0 commit comments

Comments
 (0)