فهرست منبع

reduce processing for loose tables

Yuki Takei 2 سال پیش
والد
کامیت
ab86a0dfad
1فایلهای تغییر یافته به همراه9 افزوده شده و 8 حذف شده
  1. 9 8
      packages/micromark-extension-gfm-table/dev/lib/syntax.js

+ 9 - 8
packages/micromark-extension-gfm-table/dev/lib/syntax.js

@@ -187,16 +187,17 @@ function tokenizeTable(effects, ok, nok) {
     effects.enter('tableHead');
     effects.enter('tableRow');
 
+    // increment row count
+    const crrRowCount = prevRowCount + 1;
+    containerState.rowCount = crrRowCount;
+
+    // Max 2 rows processing before delimiter row
+    if (hasDelimiterRow || crrRowCount > 2) {
+      return nok(code);
+    }
+
     // If we start with a pipe, we open a cell marker.
     if (code === codes.verticalBar) {
-      // increment row count
-      const crrRowCount = prevRowCount + 1;
-      containerState.rowCount = crrRowCount;
-
-      // Max 2 rows processing before delimiter row
-      if (hasDelimiterRow || crrRowCount > 2) {
-        return nok(code);
-      }
       return cellDividerHead(code);
     }