summaryrefslogtreecommitdiff
path: root/src/Tables.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Tables.zig')
-rw-r--r--src/Tables.zig9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/Tables.zig b/src/Tables.zig
index 765975dc..552d19d6 100644
--- a/src/Tables.zig
+++ b/src/Tables.zig
@@ -296,7 +296,8 @@ fn reflow(t: *Tables, gpa: std.mem.Allocator, f: *File.State) !void {
// Its tables, found as the whole text's are, then put in the old ones' place.
const before = t.list.items.len;
const prev = if (r0 == 0) "" else lineOf(content, starts, r0 - 1).text;
- const prev_blank = r0 == 0 or blank(prev) or closesAny(prev) or std.mem.startsWith(u8, prev[@min(indentOf(prev), prev.len)..], "#");
+ // Any fence line closes a block (a header may follow it).
+ const prev_blank = r0 == 0 or blank(prev) or fenceOf(prev) != null or std.mem.startsWith(u8, prev[@min(indentOf(prev), prev.len)..], "#");
const head = lineOf(content, starts, r0);
var at: Resume = .{ .at = head.start, .n = head.n, .fence = null, .prev_blank = prev_blank };
_ = try t.scanFrom(gpa, content, &at, @intCast(r1), false, 0, std.math.maxInt(u32));
@@ -307,12 +308,6 @@ fn reflow(t: *Tables, gpa: std.mem.Allocator, f: *File.State) !void {
t.lines = starts.len;
}
-/// Whether a line closes some fence (any fence line does, to the block
-/// after it: a header may follow it).
-fn closesAny(text: []const u8) bool {
- return fenceOf(text) != null;
-}
-
pub fn isMarkdown(path: []const u8) bool {
return std.ascii.endsWithIgnoreCase(path, ".md") or std.ascii.endsWithIgnoreCase(path, ".markdown");
}