Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Youssef1313 committed May 18, 2021
1 parent 69ad011 commit b6159fc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,7 @@ private static ClassifiedTextRunStyle GetClassifiedTextRunStyle(TaggedTextStyle
result |= ClassifiedTextRunStyle.Underline;
}

if ((style & TaggedTextStyle.Code) == TaggedTextStyle.Code ||
(style & TaggedTextStyle.InlineCode) == TaggedTextStyle.InlineCode)
if ((style & TaggedTextStyle.Code) == TaggedTextStyle.Code)
{
result |= ClassifiedTextRunStyle.UseClassificationFont;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Features/Core/Portable/Common/TaggedTextStyle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ internal enum TaggedTextStyle

Code = 1 << 3,

InlineCode = 1 << 4,
PreserveWhitespace = 1 << 4,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ private static void AppendTextFromNode(FormatterState state, XNode node, Compila
else if (name is DocumentationCommentXmlNames.CElementName or "tt")
{
needPopStyle = true;
state.PushStyle(TaggedTextStyle.InlineCode);
state.PushStyle(TaggedTextStyle.Code | TaggedTextStyle.PreserveWhitespace);
}
else if (name == DocumentationCommentXmlNames.CodeElementName)
{
Expand Down Expand Up @@ -559,7 +559,7 @@ private static string TrimCrefPrefix(string value)
private static void AppendTextFromTextNode(FormatterState state, XText element)
{
var rawText = element.Value;
if (state.Style == TaggedTextStyle.Code)
if ((state.Style & TaggedTextStyle.PreserveWhitespace) == TaggedTextStyle.PreserveWhitespace)
{
// Don't normalize code from middle. Only trim leading/trailing new lines.
state.AppendString(rawText.Trim('\n'));
Expand Down

0 comments on commit b6159fc

Please sign in to comment.