- private static function tagToBBCodeSub(DOMDocument $doc, $tag, $attributes, $startbb, $endbb)
+ /**
+ * Search the first specific HTML tag node in the provided DOM document and replaces it with BBCode text nodes.
+ *
+ * @param DOMDocument $doc
+ * @param string $tag HTML tag name
+ * @param array $attributes Array of attributes to match and optionally use the value from
+ * @param string $startbb BBCode tag opening
+ * @param string $endbb BBCode tag closing
+ * @param bool $ignoreChildren If set to false, the HTML tag children will be appended as text inside the BBCode tag
+ * Otherwise, they will be entirely ignored. Useful for simple BBCode that draw their
+ * inner value from an attribute value and disregard the tag children.
+ * @return bool Whether a replacement was done
+ */
+ private static function tagToBBCodeSub(DOMDocument $doc, string $tag, array $attributes, string $startbb, string $endbb, bool $ignoreChildren = false)