PTMLIndentedOstream: honor GenerateTagLessPTML

Before this commit PTMLIndentOstream was still emitting tag around
indentation, even when GenerateTagLessPTML was true.
This commit fixes the problem.
This commit is contained in:
Pietro Fezzardi
2024-06-27 22:10:01 +02:00
parent a1bc9b10f4
commit 7fa7b3cbe2
+7 -3
View File
@@ -40,9 +40,13 @@ void PTMLIndentedOstream::write_impl(const char *Ptr, size_t Size) {
void PTMLIndentedOstream::writeIndent() {
if (IndentDepth > 0) {
OS << B.getTag(tags::Span, std::string(IndentSize * IndentDepth, ' '))
.addAttribute(attributes::Token, ptml::tokens::Indentation)
.serialize();
Tag IndentTag = B.getTag(tags::Span,
std::string(IndentSize * IndentDepth, ' '));
if (not B.isGenerateTagLessPTML())
IndentTag.addAttribute(attributes::Token, ptml::tokens::Indentation);
OS << IndentTag.serialize();
}
TrailingNewline = false;
}