When formatting Javadocs, we use a state machine to track what we should be escaping and when. In the case of non-code blocks, we generally HTML-escape all characters except @, which must be encoded using a Javadoc {@literal @} block. If we see a sequence of @ characters, we enter a state where we try to print as many @s as possible before closing the @literal block. Unfortunately, there is a bug whereby when closing the literal block (because we have seen a non-@ character), we do not HTML-escape the first character after it. This commit fixes this issue.
When formatting Javadocs, we use a state machine to track what we should be escaping and when. In the case of non-code blocks, we generally HTML-escape all characters except
@
, which must be encoded using a Javadoc{@literal @}
block. If we see a sequence of@
characters, we enter a state where we try to print as many@
s as possible before closing the@literal
block. Unfortunately, there is a bug whereby when closing the literal block (because we have seen a non-@
character), we do not HTML-escape the first character after it. This commit fixes this issue.Fixes #1408