protected function whitespaceBetweenInlineElements($contents, PlaceholderContainer $placeholderContainer)
    {
        $elementsRegex = $this->getInlineElementsRegex();

        return preg_replace_callback(
            '/
                (
                    <('.$elementsRegex.')       # Match the start tag and capture it
                    (?:(?!<\/\2>).*)            # Match everything without the end tag
                    <\/\2>                      # Match the captured elements end tag
                )
                \s+                             # Match minimal 1 whitespace between the elements
                <('.$elementsRegex.')           # Match the start of the next inline element
            /xi',
            function ($match) use ($placeholderContainer) {
                // Where going to respect one space between the inline elements.
                $placeholder = $placeholderContainer->createPlaceholder(' ');

                return $match[1].$placeholder.'<'.$match[3];
        }, $contents);
    }