Skip to content

Commit ebb1a34

Browse files
author
Devin Torres
committed
Merge pull request vmg#129 from jmendeth/remove-flags
Remove HTML_SAFELINK and EXT_LAX_SPACING
2 parents 8d7bb2e + 108ee1a commit ebb1a34

File tree

5 files changed

+2
-46
lines changed

5 files changed

+2
-46
lines changed

bin/hoedown.c

-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ static struct extension_info extensions_info[] = {
6666
{HOEDOWN_EXT_SUPERSCRIPT, "superscript", "Parse super^script."},
6767
{HOEDOWN_EXT_MATH, "math", "Parse TeX $$math$$ syntax, Kramdown style."},
6868

69-
{HOEDOWN_EXT_LAX_SPACING, "lax-spacing", "Don't require a blank line between some blocks."},
7069
{HOEDOWN_EXT_NO_INTRA_EMPHASIS, "disable-intra-emphasis", "Disable emphasis_between_words."},
7170
{HOEDOWN_EXT_SPACE_HEADERS, "space-headers", "Require a space after '#' in headers."},
7271
{HOEDOWN_EXT_MATH_EXPLICIT, "math-explicit", "Instead of guessing by context, parse $inline math$ and $$always block math$$ (requires --math)."},
@@ -77,7 +76,6 @@ static struct extension_info extensions_info[] = {
7776
static struct html_flag_info html_flags_info[] = {
7877
{HOEDOWN_HTML_SKIP_HTML, "skip-html", "Strip all HTML tags."},
7978
{HOEDOWN_HTML_ESCAPE, "escape", "Escape all HTML."},
80-
{HOEDOWN_HTML_SAFELINK, "safelink", "Only allow links to safe protocols."},
8179
{HOEDOWN_HTML_HARD_WRAP, "hard-wrap", "Render each linebreak as <br>."},
8280
{HOEDOWN_HTML_USE_XHTML, "xhtml", "Render XHTML."},
8381
};

src/document.c

-31
Original file line numberDiff line numberDiff line change
@@ -1638,37 +1638,6 @@ parse_paragraph(hoedown_buffer *ob, hoedown_document *doc, uint8_t *data, size_t
16381638
break;
16391639
}
16401640

1641-
/*
1642-
* Early termination of a paragraph with the same logic
1643-
* as Markdown 1.0.0. If this logic is applied, the
1644-
* Markdown 1.0.3 test suite won't pass cleanly
1645-
*
1646-
* :: If the first character in a new line is not a letter,
1647-
* let's check to see if there's some kind of block starting
1648-
* here
1649-
*/
1650-
if ((doc->ext_flags & HOEDOWN_EXT_LAX_SPACING) && !isalnum(data[i])) {
1651-
if (prefix_oli(data + i, size - i) ||
1652-
prefix_uli(data + i, size - i)) {
1653-
end = i;
1654-
break;
1655-
}
1656-
1657-
/* see if an html block starts here */
1658-
if (data[i] == '<' && doc->md.blockhtml &&
1659-
parse_htmlblock(ob, doc, data + i, size - i, 0)) {
1660-
end = i;
1661-
break;
1662-
}
1663-
1664-
/* see if a code fence starts here */
1665-
if ((doc->ext_flags & HOEDOWN_EXT_FENCED_CODE) != 0 &&
1666-
is_codefence(data + i, size - i, NULL, NULL)) {
1667-
end = i;
1668-
break;
1669-
}
1670-
}
1671-
16721641
i = end;
16731642
}
16741643

src/document.h

-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ typedef enum hoedown_extensions {
3131
HOEDOWN_EXT_MATH = (1 << 9),
3232

3333
/* other flags */
34-
HOEDOWN_EXT_LAX_SPACING = (1 << 10),
3534
HOEDOWN_EXT_NO_INTRA_EMPHASIS = (1 << 11),
3635
HOEDOWN_EXT_SPACE_HEADERS = (1 << 12),
3736
HOEDOWN_EXT_MATH_EXPLICIT = (1 << 13),
@@ -55,7 +54,6 @@ typedef enum hoedown_extensions {
5554
HOEDOWN_EXT_MATH )
5655

5756
#define HOEDOWN_EXT_FLAGS (\
58-
HOEDOWN_EXT_LAX_SPACING |\
5957
HOEDOWN_EXT_NO_INTRA_EMPHASIS |\
6058
HOEDOWN_EXT_SPACE_HEADERS |\
6159
HOEDOWN_EXT_MATH_EXPLICIT )

src/html.c

-8
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@ rndr_autolink(hoedown_buffer *ob, const hoedown_buffer *link, hoedown_autolink_t
6363
if (!link || !link->size)
6464
return 0;
6565

66-
if ((state->flags & HOEDOWN_HTML_SAFELINK) != 0 &&
67-
!hoedown_autolink_is_safe(link->data, link->size) &&
68-
type != HOEDOWN_AUTOLINK_EMAIL)
69-
return 0;
70-
7166
HOEDOWN_BUFPUTSL(ob, "<a href=\"");
7267
if (type == HOEDOWN_AUTOLINK_EMAIL)
7368
HOEDOWN_BUFPUTSL(ob, "mailto:");
@@ -238,9 +233,6 @@ rndr_link(hoedown_buffer *ob, const hoedown_buffer *link, const hoedown_buffer *
238233
{
239234
hoedown_html_renderer_state *state = opaque;
240235

241-
if (link != NULL && (state->flags & HOEDOWN_HTML_SAFELINK) != 0 && !hoedown_autolink_is_safe(link->data, link->size))
242-
return 0;
243-
244236
HOEDOWN_BUFPUTSL(ob, "<a href=\"");
245237

246238
if (link && link->size)

src/html.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ extern "C" {
1818
typedef enum hoedown_html_flags {
1919
HOEDOWN_HTML_SKIP_HTML = (1 << 0),
2020
HOEDOWN_HTML_ESCAPE = (1 << 1),
21-
HOEDOWN_HTML_SAFELINK = (1 << 2),
22-
HOEDOWN_HTML_HARD_WRAP = (1 << 3),
23-
HOEDOWN_HTML_USE_XHTML = (1 << 4)
21+
HOEDOWN_HTML_HARD_WRAP = (1 << 2),
22+
HOEDOWN_HTML_USE_XHTML = (1 << 3)
2423
} hoedown_html_flags;
2524

2625
typedef enum hoedown_html_tag {

0 commit comments

Comments
 (0)