cmark

My personal build of CMark ✏️

Commit
7ebd66bdda69f0d580e54b6f272d6ec7ed54fa1e
Parent
8950065009608ec71bd86516de8f66a9646557ee
Author
John MacFarlane <jgm@berkeley.edu>
Date

js: 'ListItem' -> 'Item'.

Diffstat

3 files changed, 8 insertions, 8 deletions

Status File Name N° Changes Insertions Deletions
Modified js/lib/blocks.js 12 6 6
Modified js/lib/html.js 2 1 1
Modified js/lib/node.js 2 1 1
diff --git a/js/lib/blocks.js b/js/lib/blocks.js
@@ -94,8 +94,8 @@ var canContain = function(parent_type, child_type) {
     "use strict";
     return ( parent_type === 'Document' ||
              parent_type === 'BlockQuote' ||
-             parent_type === 'ListItem' ||
-             (parent_type === 'List' && child_type === 'ListItem') );
+             parent_type === 'Item' ||
+             (parent_type === 'List' && child_type === 'Item') );
 };
 
 // Returns true if block type can accept lines of text.
@@ -114,7 +114,7 @@ var endsWithBlankLine = function(block) {
         if (block.last_line_blank) {
             return true;
         }
-        if (block.t === 'List' || block.t === 'ListItem') {
+        if (block.t === 'List' || block.t === 'Item') {
             block = block.lastChild;
         } else {
             break;
@@ -286,7 +286,7 @@ var incorporateLine = function(ln, line_number) {
             }
             break;
 
-        case 'ListItem':
+        case 'Item':
             if (indent >= container.list_data.marker_offset +
                 container.list_data.padding) {
                 offset += container.list_data.marker_offset +
@@ -466,7 +466,7 @@ var incorporateLine = function(ln, line_number) {
             }
 
             // add the list item
-            container = this.addChild('ListItem', line_number, first_nonspace);
+            container = this.addChild('Item', line_number, first_nonspace);
             container.list_data = data;
 
         } else {
@@ -516,7 +516,7 @@ var incorporateLine = function(ln, line_number) {
             !(container.t === 'BlockQuote' ||
               container.t === 'Header' ||
               container.t === 'FencedCode' ||
-              (container.t === 'ListItem' &&
+              (container.t === 'Item' &&
                !container.firstChild &&
                container.sourcepos[0][0] === line_number));
 
diff --git a/js/lib/html.js b/js/lib/html.js
@@ -158,7 +158,7 @@ var renderNodes = function(block) {
             }
             break;
 
-        case 'ListItem':
+        case 'Item':
             if (entering) {
                 out(tag('li', attrs));
             } else {
diff --git a/js/lib/node.js b/js/lib/node.js
@@ -5,7 +5,7 @@ function isContainer(node) {
     case 'Document':
     case 'BlockQuote':
     case 'List':
-    case 'ListItem':
+    case 'Item':
     case 'Paragraph':
     case 'Header':
     case 'Emph':