bertysentry commented on a change in pull request #49:
URL: https://github.com/apache/maven-doxia/pull/49#discussion_r549795508



##########
File path: 
doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSink.java
##########
@@ -1905,7 +1905,9 @@ private void inlineSemantics( SinkEventAttributes 
attributes, String semantic,
     {
         if ( attributes.containsAttribute( SinkEventAttributes.SEMANTICS, 
semantic ) )
         {
-            writeStartTag( tag );
+            SinkEventAttributes attributesNoSemantics = ( SinkEventAttributes 
) attributes.copyAttributes();
+            attributesNoSemantics.removeAttribute( 
SinkEventAttributes.SEMANTICS );

Review comment:
       *inline* Sink events may have attributes that we want to leverage 
(notably the *Class* attribute).
   
   Example: *inline* Sink event with `Semantics = "code"` and `Class = 
"language-java"` will be output as `<code class="language-java">`.
   
   Note: We don't want to output `<code semantics="code" 
class="language-java">` and that's why we need to remove the *SEMANTICS* 
attribute.
   
   Admittedly, the *inlineSemantics()* function is not the most elegant piece 
of code but I didn't want to reshuffle the XHTML Sink too much, as it's used in 
many different places.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to