Merge pull request #7695 from ruibaby/feat/comment-a-target

Allow target attribute on <a> tags in comment sanitizer
pull/7700/head
Ryan Wang 2025-08-17 23:38:00 +08:00 committed by GitHub
parent 3105c53b6f
commit 3345ccb035
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -28,7 +28,9 @@ public abstract class AbstractCommentService {
// Allow <s> tag, which is used for strikethrough
.addTags("s")
// Allow <code> tag's class attribute, for syntax highlighting
.addAttributes("code", "class");
.addAttributes("code", "class")
// Allow <a> tag's target attribute
.addAttributes("a", "target");
protected Mono<User> fetchCurrentUser() {
return ReactiveSecurityContextHolder.getContext()