mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user