blob: 0a5fb01adc9aa57db4af36d35177de97fff338d1 [file] [log] [blame]
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import '../ast.dart';
import '../inline_parser.dart';
import 'inline_syntax.dart';
/// Represents a hard line break.
class LineBreakSyntax extends InlineSyntax {
LineBreakSyntax() : super(r'(?:\\| +)\n');
/// Create a void <br> element.
@override
bool onMatch(InlineParser parser, Match match) {
parser.addNode(Element.empty('br'));
return true;
}
}