summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2014-11-25 14:51:54 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2014-11-25 14:51:54 -0800
commita5a55657ad8c1da1e17eda8e0a321612e61c311e (patch)
treeeeffae63dff482617227c435e63bff63f2611fb7 /src
parente31e2d2fe1d28223eee9f406b82d6f48552f5be7 (diff)
Rename NODE_STRING -> NODE_TEXT.
In JS, use 'Text' instead of 'Str'. In spec, use "plain textual content" instead of "strings."
Diffstat (limited to 'src')
-rw-r--r--src/cmark.h6
-rw-r--r--src/html/html.c4
-rw-r--r--src/inlines.c2
-rw-r--r--src/node.c8
-rw-r--r--src/print.c4
5 files changed, 12 insertions, 12 deletions
diff --git a/src/cmark.h b/src/cmark.h
index 6e58f0b..d778a53 100644
--- a/src/cmark.h
+++ b/src/cmark.h
@@ -27,7 +27,7 @@ typedef enum {
CMARK_NODE_LAST_BLOCK = CMARK_NODE_REFERENCE_DEF,
// Inline
- CMARK_NODE_STRING,
+ CMARK_NODE_TEXT,
CMARK_NODE_SOFTBREAK,
CMARK_NODE_LINEBREAK,
CMARK_NODE_INLINE_CODE,
@@ -37,7 +37,7 @@ typedef enum {
CMARK_NODE_LINK,
CMARK_NODE_IMAGE,
- CMARK_NODE_FIRST_INLINE = CMARK_NODE_STRING,
+ CMARK_NODE_FIRST_INLINE = CMARK_NODE_TEXT,
CMARK_NODE_LAST_INLINE = CMARK_NODE_IMAGE,
} cmark_node_type;
@@ -204,7 +204,7 @@ char *cmark_markdown_to_html(const char *text, int len);
#define NODE_HEADER CMARK_NODE_HEADER
#define NODE_HRULE CMARK_NODE_HRULE
#define NODE_REFERENCE_DEF CMARK_NODE_REFERENCE_DEF
- #define NODE_STRING CMARK_NODE_STRING
+ #define NODE_TEXT CMARK_NODE_TEXT
#define NODE_SOFTBREAK CMARK_NODE_SOFTBREAK
#define NODE_LINEBREAK CMARK_NODE_LINEBREAK
#define NODE_INLINE_CODE CMARK_NODE_INLINE_CODE
diff --git a/src/html/html.c b/src/html/html.c
index 27d1f0e..0e3dd15 100644
--- a/src/html/html.c
+++ b/src/html/html.c
@@ -47,7 +47,7 @@ static void inlines_to_plain_html(strbuf *html, cmark_node* node)
while (true) {
switch(cur->type) {
- case NODE_STRING:
+ case NODE_TEXT:
case NODE_INLINE_CODE:
case NODE_INLINE_HTML:
escape_html(html, cur->as.literal.data, cur->as.literal.len);
@@ -191,7 +191,7 @@ static void node_to_html(strbuf *html, cmark_node *node)
case NODE_REFERENCE_DEF:
break;
- case NODE_STRING:
+ case NODE_TEXT:
escape_html(html, cur->as.literal.data, cur->as.literal.len);
break;
diff --git a/src/inlines.c b/src/inlines.c
index 9bc4e35..060b536 100644
--- a/src/inlines.c
+++ b/src/inlines.c
@@ -15,7 +15,7 @@
// Macros for creating various kinds of simple.
-#define make_str(s) make_literal(CMARK_NODE_STRING, s)
+#define make_str(s) make_literal(CMARK_NODE_TEXT, s)
#define make_code(s) make_literal(CMARK_NODE_INLINE_CODE, s)
#define make_raw_html(s) make_literal(CMARK_NODE_INLINE_HTML, s)
#define make_linebreak() make_simple(CMARK_NODE_LINEBREAK)
diff --git a/src/node.c b/src/node.c
index cdf9d60..8de46ea 100644
--- a/src/node.c
+++ b/src/node.c
@@ -59,7 +59,7 @@ S_type_string(cmark_node *node)
case CMARK_NODE_HEADER: return "HEADER";
case CMARK_NODE_HRULE: return "HRULE";
case CMARK_NODE_REFERENCE_DEF: return "REFERENCE_DEF";
- case CMARK_NODE_STRING: return "STRING";
+ case CMARK_NODE_TEXT: return "TEXT";
case CMARK_NODE_SOFTBREAK: return "SOFTBREAK";
case CMARK_NODE_LINEBREAK: return "LINEBREAK";
case CMARK_NODE_INLINE_CODE: return "INLINE_CODE";
@@ -118,7 +118,7 @@ cmark_node_get_string_content(cmark_node *node) {
case NODE_HTML:
return cmark_strbuf_cstr(&node->string_content);
- case NODE_STRING:
+ case NODE_TEXT:
case NODE_INLINE_HTML:
case NODE_INLINE_CODE:
return cmark_chunk_to_cstr(&node->as.literal);
@@ -138,7 +138,7 @@ cmark_node_set_string_content(cmark_node *node, const char *content) {
cmark_strbuf_sets(&node->string_content, content);
return 1;
- case NODE_STRING:
+ case NODE_TEXT:
case NODE_INLINE_HTML:
case NODE_INLINE_CODE:
cmark_chunk_set_cstr(&node->as.literal, content);
@@ -622,7 +622,7 @@ void cmark_free_nodes(cmark_node *e)
case NODE_CODE_BLOCK:
strbuf_free(&e->as.code.info);
break;
- case NODE_STRING:
+ case NODE_TEXT:
case NODE_INLINE_HTML:
case NODE_INLINE_CODE:
cmark_chunk_free(&e->as.literal);
diff --git a/src/print.c b/src/print.c
index 1afa584..9e5a90e 100644
--- a/src/print.c
+++ b/src/print.c
@@ -43,8 +43,8 @@ static void print_inlines(cmark_node* ils, int indent)
putchar(' ');
}
switch(ils->type) {
- case NODE_STRING:
- printf("str ");
+ case NODE_TEXT:
+ printf("text ");
print_str(ils->as.literal.data, ils->as.literal.len);
putchar('\n');
break;