Skip to content

Commit 69465c1

Browse files
committed
Prevent accidental HTML tags.
1 parent ae3ec55 commit 69465c1

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

app/lib/package/backend.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,6 +1352,8 @@ class PackageBackend {
13521352
!line.startsWith('```') && // also removes the need to escape it
13531353
!line.startsWith('---'))
13541354
.take(10)
1355+
// prevent accidental HTML-tag creation
1356+
.map((line) => line.replaceAll('<', '[').replaceAll('>', ']'))
13551357
.map((line) =>
13561358
line.length < 76 ? line : '${line.substring(0, 70)}[...]')
13571359
.join('\n');

app/lib/shared/changelog.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,6 @@ class _MarkdownVisitor extends dom_parsing.TreeVisitor {
257257
@override
258258
void visitText(html.Text node) {
259259
_result.write(node.text.normalizeAndTrim());
260-
// if (_inlineDepth > 0 &&
261-
// (node.parent?.nodes.indexOf(this) ?? -1) !=
262-
// (node.parent?.nodes.length ?? 0) - 1 &&
263-
// node.text.endsWithWhitespace()) {
264-
// _out.write(' ');
265-
// }
266260
}
267261

268262
@override

0 commit comments

Comments
 (0)