コード例 #1
0
 public override void EnterWhitespace([NotNull] TxMarkParser.WhitespaceContext context)
 {
     if (context.Parent is TxMarkParser.PhraseContext || context.Parent is TxMarkParser.HtmlAttributeValueContentContext)
     {
         var whitespace = context.GetText();
         var newLines   = whitespace.Split('\n');
         if (newLines.Length == 1)
         {
             _compileContext.Whitespace();
         }
         else
         {
             for (int i = 1; i < newLines.Length; i++)
             {
                 _compileContext.NewLine();
             }
         }
     }
     else
     {
         Debug.WriteLine($"Whitespace ignored under {context.Parent.GetType()}");
     }
 }