summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin Torres <devin@devintorr.es>2014-02-13 15:58:46 -0600
committerDevin Torres <devin@devintorr.es>2014-02-13 15:58:46 -0600
commitf51f204f6fcba0aed09ef3c4a36bf14e5f84ed82 (patch)
treedbde6e06fe75cf3eb25e8f106164a029a00c153f
parent23685b2f656f47544d7197d322bedbfab5c6e512 (diff)
parent4cb9c5b9e3c6a1d6c2b8791cd6b4de2d939d0e37 (diff)
downloadrust-hoedown-f51f204f6fcba0aed09ef3c4a36bf14e5f84ed82.tar.gz
Merge pull request #57 from jmendeth/organize-extensions
Organize flags
-rw-r--r--src/document.c4
-rw-r--r--src/document.h54
-rw-r--r--src/html.c4
3 files changed, 45 insertions, 17 deletions
diff --git a/src/document.c b/src/document.c
index 066003d..4569e21 100644
--- a/src/document.c
+++ b/src/document.c
@@ -2252,7 +2252,7 @@ parse_table_header(
i++;
if (data[i] == ':') {
- i++; (*column_data)[col] |= HOEDOWN_TABLE_ALIGN_L;
+ i++; (*column_data)[col] |= HOEDOWN_TABLE_ALIGN_LEFT;
dashes++;
}
@@ -2261,7 +2261,7 @@ parse_table_header(
}
if (i < under_end && data[i] == ':') {
- i++; (*column_data)[col] |= HOEDOWN_TABLE_ALIGN_R;
+ i++; (*column_data)[col] |= HOEDOWN_TABLE_ALIGN_RIGHT;
dashes++;
}
diff --git a/src/document.h b/src/document.h
index 841c458..3204f2c 100644
--- a/src/document.h
+++ b/src/document.h
@@ -15,21 +15,49 @@ extern "C" {
*********/
enum hoedown_extensions {
- HOEDOWN_EXT_NO_INTRA_EMPHASIS = (1 << 0),
+ /* block-level extensions */
+ HOEDOWN_EXT_SPACE_HEADERS = (1 << 0),
HOEDOWN_EXT_TABLES = (1 << 1),
HOEDOWN_EXT_FENCED_CODE = (1 << 2),
- HOEDOWN_EXT_AUTOLINK = (1 << 3),
- HOEDOWN_EXT_STRIKETHROUGH = (1 << 4),
- HOEDOWN_EXT_UNDERLINE = (1 << 5),
- HOEDOWN_EXT_SPACE_HEADERS = (1 << 6),
- HOEDOWN_EXT_SUPERSCRIPT = (1 << 7),
- HOEDOWN_EXT_LAX_SPACING = (1 << 8),
- HOEDOWN_EXT_DISABLE_INDENTED_CODE = (1 << 9),
- HOEDOWN_EXT_HIGHLIGHT = (1 << 10),
- HOEDOWN_EXT_FOOTNOTES = (1 << 11),
- HOEDOWN_EXT_QUOTE = (1 << 12)
+ HOEDOWN_EXT_FOOTNOTES = (1 << 3),
+
+ /* span-level extensions */
+ HOEDOWN_EXT_AUTOLINK = (1 << 4),
+ HOEDOWN_EXT_STRIKETHROUGH = (1 << 5),
+ HOEDOWN_EXT_UNDERLINE = (1 << 6),
+ HOEDOWN_EXT_HIGHLIGHT = (1 << 7),
+ HOEDOWN_EXT_QUOTE = (1 << 8),
+ HOEDOWN_EXT_SUPERSCRIPT = (1 << 9),
+
+ /* other flags */
+ HOEDOWN_EXT_LAX_SPACING = (1 << 10),
+ HOEDOWN_EXT_NO_INTRA_EMPHASIS = (1 << 11),
+
+ /* negative flags */
+ HOEDOWN_EXT_DISABLE_INDENTED_CODE = (1 << 12)
};
+#define HOEDOWN_EXT_BLOCK (\
+ HOEDOWN_EXT_SPACE_HEADERS |\
+ HOEDOWN_EXT_TABLES |\
+ HOEDOWN_EXT_FENCED_CODE |\
+ HOEDOWN_EXT_FOOTNOTES )
+
+#define HOEDOWN_EXT_SPAN (\
+ HOEDOWN_EXT_AUTOLINK |\
+ HOEDOWN_EXT_STRIKETHROUGH |\
+ HOEDOWN_EXT_UNDERLINE |\
+ HOEDOWN_EXT_HIGHLIGHT |\
+ HOEDOWN_EXT_QUOTE |\
+ HOEDOWN_EXT_SUPERSCRIPT )
+
+#define HOEDOWN_EXT_FLAGS (\
+ HOEDOWN_EXT_LAX_SPACING &\
+ HOEDOWN_EXT_NO_INTRA_EMPHASIS )
+
+#define HOEDOWN_NEGATIVE_FLAGS (\
+ HOEDOWN_EXT_DISABLE_INDENTED_CODE )
+
/* list/listitem flags */
enum hoedown_listflags {
HOEDOWN_LIST_ORDERED = (1 << 0),
@@ -37,8 +65,8 @@ enum hoedown_listflags {
};
enum hoedown_tableflags {
- HOEDOWN_TABLE_ALIGN_L = 1,
- HOEDOWN_TABLE_ALIGN_R = 2,
+ HOEDOWN_TABLE_ALIGN_LEFT = 1,
+ HOEDOWN_TABLE_ALIGN_RIGHT = 2,
HOEDOWN_TABLE_ALIGN_CENTER = 3,
HOEDOWN_TABLE_ALIGNMASK = 3,
HOEDOWN_TABLE_HEADER = 4
diff --git a/src/html.c b/src/html.c
index 6f1711c..7d89c46 100644
--- a/src/html.c
+++ b/src/html.c
@@ -451,11 +451,11 @@ rndr_tablecell(hoedown_buffer *ob, const hoedown_buffer *text, unsigned int flag
HOEDOWN_BUFPUTSL(ob, " style=\"text-align: center\">");
break;
- case HOEDOWN_TABLE_ALIGN_L:
+ case HOEDOWN_TABLE_ALIGN_LEFT:
HOEDOWN_BUFPUTSL(ob, " style=\"text-align: left\">");
break;
- case HOEDOWN_TABLE_ALIGN_R:
+ case HOEDOWN_TABLE_ALIGN_RIGHT:
HOEDOWN_BUFPUTSL(ob, " style=\"text-align: right\">");
break;