diff --git a/src/buffer/out/TextAttribute.cpp b/src/buffer/out/TextAttribute.cpp index d5b0e5e4a5a..fffe7e8c727 100644 --- a/src/buffer/out/TextAttribute.cpp +++ b/src/buffer/out/TextAttribute.cpp @@ -288,6 +288,11 @@ bool TextAttribute::IsItalic() const noexcept return WI_IsFlagSet(_attrs, CharacterAttributes::Italics); } +bool TextAttribute::IsBold() const noexcept +{ + return WI_IsFlagSet(_attrs, CharacterAttributes::Bold); +} + bool TextAttribute::IsBlinking() const noexcept { return WI_IsFlagSet(_attrs, CharacterAttributes::Blinking); diff --git a/src/buffer/out/TextAttribute.hpp b/src/buffer/out/TextAttribute.hpp index 4fe8c9e637e..5341c4e3c9e 100644 --- a/src/buffer/out/TextAttribute.hpp +++ b/src/buffer/out/TextAttribute.hpp @@ -108,6 +108,7 @@ class TextAttribute final bool IsFaint() const noexcept; bool IsItalic() const noexcept; bool IsBlinking() const noexcept; + bool IsBold() const noexcept; bool IsInvisible() const noexcept; bool IsCrossedOut() const noexcept; bool IsUnderlined() const noexcept; diff --git a/src/buffer/out/textBuffer.cpp b/src/buffer/out/textBuffer.cpp index c4c66ca92e4..5a67ea867fb 100644 --- a/src/buffer/out/textBuffer.cpp +++ b/src/buffer/out/textBuffer.cpp @@ -2063,6 +2063,7 @@ std::string TextBuffer::GenHTML(const TextAndColor& rows, auto hasWrittenAnyText = false; std::optional fgColor = std::nullopt; std::optional bkColor = std::nullopt; + TextAttribute textProps; for (size_t row = 0; row < rows.text.size(); row++) { size_t startOffset = 0; @@ -2137,6 +2138,15 @@ std::string TextBuffer::GenHTML(const TextAndColor& rows, htmlBuilder << "background-color:"; htmlBuilder << Utils::ColorToHexString(bkColor.value()); htmlBuilder << ";"; + htmlBuilder << "text-decoration:"; + htmlBuilder << textProps.IsUnderlined(); + htmlBuilder << ";"; + htmlBuilder << "font-weight:"; + htmlBuilder << textProps.IsBold(); + htmlBuilder << ";"; + htmlBuilder << "font-style:"; + htmlBuilder << textProps.IsItalic(); + htmlBuilder << ";"; htmlBuilder << "\">"; } diff --git a/src/inc/conattrs.hpp b/src/inc/conattrs.hpp index a61407e5b14..47105854d66 100644 --- a/src/inc/conattrs.hpp +++ b/src/inc/conattrs.hpp @@ -14,6 +14,7 @@ enum class CharacterAttributes : uint16_t Normal = 0x00, Intense = 0x01, Italics = 0x02, + Bold = 0x03, Blinking = 0x04, Invisible = 0x08, CrossedOut = 0x10,