Class HeadingIdAttributeProvider

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private HeadingIdAttributeProvider​(java.lang.String defaultId, java.lang.String prefix, java.lang.String suffix)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static HeadingIdAttributeProvider create​(java.lang.String defaultId, java.lang.String prefix, java.lang.String suffix)  
      void setAttributes​(Node node, java.lang.String tagName, java.util.Map<java.lang.String,​java.lang.String> attributes)
      Set the attributes for a HTML tag of the specified node by modifying the provided map.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

    • Constructor Detail

      • HeadingIdAttributeProvider

        private HeadingIdAttributeProvider​(java.lang.String defaultId,
                                           java.lang.String prefix,
                                           java.lang.String suffix)
    • Method Detail

      • create

        public static HeadingIdAttributeProvider create​(java.lang.String defaultId,
                                                        java.lang.String prefix,
                                                        java.lang.String suffix)
      • setAttributes

        public void setAttributes​(Node node,
                                  java.lang.String tagName,
                                  java.util.Map<java.lang.String,​java.lang.String> attributes)
        Description copied from interface: AttributeProvider
        Set the attributes for a HTML tag of the specified node by modifying the provided map.

        This allows to change or even remove default attributes. With great power comes great responsibility.

        The attribute key and values will be escaped (preserving character entities), so don't escape them here, otherwise they will be double-escaped.

        This method may be called multiple times for the same node, if the node is rendered using multiple nested tags (e.g. code blocks).

        Specified by:
        setAttributes in interface AttributeProvider
        Parameters:
        node - the node to set attributes for
        tagName - the HTML tag name that these attributes are for (e.g. h1, pre, code).
        attributes - the attributes, with any default attributes already set in the map