Browse Source

Add companion hint and searchable content methods to SemanticTag

Marcin Ziąbek 6 days ago
parent
commit
274aa6429c
1 changed files with 12 additions and 0 deletions
  1. 12 0
      Source/QuestPDF/Elements/SemanticTag.cs

+ 12 - 0
Source/QuestPDF/Elements/SemanticTag.cs

@@ -109,4 +109,16 @@ internal class SemanticTag : ContainerElement, ISemanticAware
             currentChild = (currentChild as ContainerElement)?.Child;
         }
     }
+
+    internal override string? GetCompanionHint()
+    {
+        var result = TagType;
+        
+        if (!string.IsNullOrWhiteSpace(Alt))
+            result += $" ({Alt})";
+        
+        return result;
+    }
+    
+    internal override string? GetCompanionSearchableContent() => TagType;
 }