md_analyze_marks: Remove unneeded parameters.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
diff --git a/md4c/md4c.c b/md4c/md4c.c
index f56ba3e..43f7e83 100644
--- a/md4c/md4c.c
+++ b/md4c/md4c.c
@@ -3271,7 +3271,7 @@ md_analyze_bracket(MD_CTX* ctx, int mark_index)
/* Forward declaration. */
static void md_analyze_link_contents(MD_CTX* ctx, const MD_LINE* lines, int n_lines,
- OFF beg, OFF end, int mark_beg, int mark_end);
+ int mark_beg, int mark_end);
static int
md_resolve_links(MD_CTX* ctx, const MD_LINE* lines, int n_lines)
@@ -3405,7 +3405,7 @@ md_resolve_links(MD_CTX* ctx, const MD_LINE* lines, int n_lines)
last_img_end = closer->end;
}
- md_analyze_link_contents(ctx, lines, n_lines, opener->end, closer->beg, opener_index+1, closer_index);
+ md_analyze_link_contents(ctx, lines, n_lines, opener_index+1, closer_index);
}
opener_index = next_index;
@@ -3687,22 +3687,13 @@ md_analyze_permissive_email_autolink(MD_CTX* ctx, int mark_index)
static void
md_analyze_marks(MD_CTX* ctx, const MD_LINE* lines, int n_lines,
- OFF beg, OFF end, int mark_beg, int mark_end,
- const CHAR* mark_chars)
+ int mark_beg, int mark_end, const CHAR* mark_chars)
{
int i = mark_beg;
while(i < mark_end) {
MD_MARK* mark = &ctx->marks[i];
- /* Do not care about marks outside the given range. */
- if(mark->end > end && mark->ch != 'D')
- break;
- if(mark->beg < beg && mark->ch != 'D') {
- i++;
- continue;
- }
-
/* Skip resolved spans. */
if(mark->flags & MD_MARK_RESOLVED) {
if(mark->flags & MD_MARK_OPENER) {
@@ -3747,8 +3738,6 @@ static int
md_analyze_inlines(MD_CTX* ctx, const MD_LINE* lines, int n_lines, int table_mode)
{
int ret;
- OFF beg = lines[0].beg;
- OFF end = lines[n_lines-1].end;
/* Reset the previously collected stack of marks. */
ctx->n_marks = 0;
@@ -3759,13 +3748,13 @@ md_analyze_inlines(MD_CTX* ctx, const MD_LINE* lines, int n_lines, int table_mod
/* We analyze marks in few groups to handle their precedence. */
/* (1) Entities; code spans; autolinks; raw HTML. */
- md_analyze_marks(ctx, lines, n_lines, beg, end, 0, ctx->n_marks, _T("&`<>"));
+ md_analyze_marks(ctx, lines, n_lines, 0, ctx->n_marks, _T("&`<>"));
BACKTICK_OPENERS.head = -1;
BACKTICK_OPENERS.tail = -1;
LOWERTHEN_OPENERS.head = -1;
LOWERTHEN_OPENERS.tail = -1;
/* (2) Links. */
- md_analyze_marks(ctx, lines, n_lines, beg, end, 0, ctx->n_marks, _T("[]!"));
+ md_analyze_marks(ctx, lines, n_lines, 0, ctx->n_marks, _T("[]!"));
MD_CHECK(md_resolve_links(ctx, lines, n_lines));
BRACKET_OPENERS.head = -1;
BRACKET_OPENERS.tail = -1;
@@ -3779,10 +3768,10 @@ md_analyze_inlines(MD_CTX* ctx, const MD_LINE* lines, int n_lines, int table_mod
TABLECELLBOUNDARIES.head = -1;
TABLECELLBOUNDARIES.tail = -1;
ctx->n_table_cell_boundaries = 0;
- md_analyze_marks(ctx, lines, n_lines, beg, end, 0, ctx->n_marks, _T("|"));
+ md_analyze_marks(ctx, lines, n_lines, 0, ctx->n_marks, _T("|"));
} else {
/* (3b) Emphasis and strong emphasis; permissive autolinks. */
- md_analyze_link_contents(ctx, lines, n_lines, beg, end, 0, ctx->n_marks);
+ md_analyze_link_contents(ctx, lines, n_lines, 0, ctx->n_marks);
}
abort:
@@ -3791,9 +3780,9 @@ abort:
static void
md_analyze_link_contents(MD_CTX* ctx, const MD_LINE* lines, int n_lines,
- OFF beg, OFF end, int mark_beg, int mark_end)
+ int mark_beg, int mark_end)
{
- md_analyze_marks(ctx, lines, n_lines, beg, end, mark_beg, mark_end, _T("*_~@:."));
+ md_analyze_marks(ctx, lines, n_lines, mark_beg, mark_end, _T("*_~@:."));
ASTERISK_OPENERS.head = -1;
ASTERISK_OPENERS.tail = -1;
UNDERSCORE_OPENERS.head = -1;